Summary: | Web Inspector: Enum value collisions between different generators | ||||||
---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Joseph Pecoraro <joepeck> | ||||
Component: | Web Inspector | Assignee: | Joseph Pecoraro <joepeck> | ||||
Status: | RESOLVED FIXED | ||||||
Severity: | Normal | CC: | burg, commit-queue, graouts, joepeck, timothy, webkit-bug-importer | ||||
Priority: | P2 | Keywords: | InRadar | ||||
Version: | 528+ (Nightly build) | ||||||
Hardware: | All | ||||||
OS: | All | ||||||
Attachments: |
|
I have a fix, I need to make a test. Created attachment 240899 [details] [PATCH] Proposed Fix Before the patch you can see the collision. > FAIL: enum-values.json-result > --- JavaScriptCore/inspector/scripts/tests/expected/enum-values.json-result 2014-11-03 18:50:12.000000000 -0800 > +++ /var/folders/_b/scj8wvc516g_708gsbsfwq5w0000gn/T/tmpg_18v0/enum-values.json-result 2014-11-03 18:50:33.000000000 -0800 > @@ -159,9 +159,9 @@ > // Named after parameter 'returnValue' while generating command/event commandWithEnumReturnValue. > enum class ReturnValue { > Shared = 0, > - Cyan = 1, > - Magenta = 2, > - Yellow = 3, > + Cyan = 6, > + Magenta = 7, > + Yellow = 8, > }; // enum class ReturnValue > virtual void commandWithEnumReturnValue(ErrorString&, InspectorCommandDomainBackendDispatcherHandler::ReturnValue* out_returnValue) = 0; > protected: > @@ -343,8 +343,8 @@ > // Named after parameter 'parameter' while generating command/event eventWithEnumParameter. > enum class Parameter { > Shared = 0, > - Black = 1, > - White = 2, > + Black = 4, > + White = 5, > }; // enum class Parameter > void eventWithEnumParameter(Parameter parameter); > private: This patch modifies the inspector protocol generator. Please ensure that you have rebaselined any generator test results (i.e., by running `Tools/Scripts/run-inspector-generator-tests --reset-results`) Comment on attachment 240899 [details]
[PATCH] Proposed Fix
Hmm, hadn't thought about that case.. thanks for the patch!
Comment on attachment 240899 [details] [PATCH] Proposed Fix Clearing flags on attachment: 240899 Committed r175546: <http://trac.webkit.org/changeset/175546> All reviewed patches have been landed. Closing bug. |
* SUMMARY Sending Debugger.pause reason "InspectorDebuggerFrontendDispatcher::Reason::Exception" across to the frontend actually sends the string "WebSocket" instead of "exception". There is a collision between enum values for the different dispatchers. Generated code had both: > // InspectorProtocolObjects.h > > namespace Timeline { > enum class EventType { > ... > WebSocketDestroy = 133, > }; > } > > // InspectorFrontendDispatchers.h > > class InspectorDebuggerFrontendDispatcher { > public: > ... > enum class Reason { > Exception = 133, > }; > } We need to ensure that the values we generate are unique across all enums in all domains, not just the domains being generated for that particular dispatcher.