Summary: | Web Inspector: [Protocol] Generate JS enum definitions. | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Eugene Klyuchnikov <eustas> | ||||||||||||
Component: | Web Inspector (Deprecated) | Assignee: | Eugene Klyuchnikov <eustas> | ||||||||||||
Status: | RESOLVED FIXED | ||||||||||||||
Severity: | Normal | CC: | aandrey, apavlov, graouts, joepeck, keishi, loislo, pfeldman, pmuellr, timothy, vsevik, web-inspector-bugs, webkit.review.bot, yurys | ||||||||||||
Priority: | P2 | ||||||||||||||
Version: | 528+ (Nightly build) | ||||||||||||||
Hardware: | All | ||||||||||||||
OS: | All | ||||||||||||||
Attachments: |
|
Description
Eugene Klyuchnikov
2013-02-21 05:51:05 PST
Created attachment 189527 [details]
Patch
This is exiting! Could you plz also attach diffs of the generated files as a patch? (In reply to comment #2) > This is exiting! > Could you plz also attach diffs of the generated files as a patch? Diff for protocol-externs.js: http://diffchecker.com/1l1aEUqu Diff for InspectorBackendCommands.js: http://diffchecker.com/67s9Jkv5 Comment on attachment 189527 [details]
Patch
You should produce CamelCase enum literals per WebKit code guidelines.
Created attachment 189710 [details]
Patch
Could you attach the diff in the generated files as a patch to this bug? Updated literal names. New diffs: protocol-externs.js: http://diffchecker.com/p0799b5q InspectorBackendCommands.js: http://www.diffchecker.com/69982Uz9 Could you attach the diff in the generated files as a patch to this bug? Created attachment 189713 [details]
Diff of generated files.
Comment on attachment 189713 [details] Diff of generated files. View in context: https://bugs.webkit.org/attachment.cgi?id=189713&action=review > new/InspectorBackendCommands.js:91 > +InspectorBackend.registerEnum("Console.ConsoleMessageSource", {Html: "html", Wml: "wml", Xml: "xml", Javascript: "javascript", Network: "network", ConsoleApi: "console-api", Other: "other"}); You should special case acronyms to make them all CAPS. Html => HTML, ConsoleApi => ConsoleAPI, etc. Comment on attachment 189710 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=189710&action=review > Source/WebCore/inspector/front-end/InspectorBackend.js:85 > + var domainAndMethod = type.split("."); You need to call this from loadFromJSONIfNeeded as well. Comment on attachment 189710 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=189710&action=review > Source/WebCore/inspector/front-end/InspectorBackend.js:90 > + this._initialized = true; Is this correct? seems suspicious to have this line both in registerCommand and registerEnum Created attachment 190278 [details]
Patch
Comment on attachment 189710 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=189710&action=review >> Source/WebCore/inspector/front-end/InspectorBackend.js:85 >> + var domainAndMethod = type.split("."); > > You need to call this from loadFromJSONIfNeeded as well. Done. >> Source/WebCore/inspector/front-end/InspectorBackend.js:90 >> + this._initialized = true; > > Is this correct? seems suspicious to have this line both in registerCommand and registerEnum As I see, this marker is used do avoid recursion/repetitive loading. So, all 3 methods should mark instance as initialized. Comment on attachment 189713 [details] Diff of generated files. View in context: https://bugs.webkit.org/attachment.cgi?id=189713&action=review >> new/InspectorBackendCommands.js:91 >> +InspectorBackend.registerEnum("Console.ConsoleMessageSource", {Html: "html", Wml: "wml", Xml: "xml", Javascript: "javascript", Network: "network", ConsoleApi: "console-api", Other: "other"}); > > You should special case acronyms to make them all CAPS. Html => HTML, ConsoleApi => ConsoleAPI, etc. Fixed Created attachment 190280 [details]
Difference in generated files.
Comment on attachment 190278 [details] Patch Clearing flags on attachment: 190278 Committed r144265: <http://trac.webkit.org/changeset/144265> All reviewed patches have been landed. Closing bug. |