RESOLVED FIXED 44338
Web Inspector: inspector protocol should be switched from array to object based representation.
https://bugs.webkit.org/show_bug.cgi?id=44338
Summary Web Inspector: inspector protocol should be switched from array to object bas...
Ilya Tikhonovsky
Reported 2010-08-20 09:02:30 PDT
%subj%
Attachments
[patch] initial version. (29.65 KB, patch)
2010-08-20 12:31 PDT, Ilya Tikhonovsky
no flags
sample: InspectorBackendDispatcher.cpp (202.63 KB, text/plain)
2010-08-20 13:20 PDT, Ilya Tikhonovsky
no flags
sample: InspectorBackendStub.js (16.27 KB, text/plain)
2010-08-20 13:20 PDT, Ilya Tikhonovsky
no flags
sample: RemoteInspectorFrontend.cpp (34.83 KB, text/plain)
2010-08-20 13:21 PDT, Ilya Tikhonovsky
no flags
[patch] second iteration (32.41 KB, patch)
2010-08-23 03:18 PDT, Ilya Tikhonovsky
no flags
sample: InspectorBackendStub.js (13.49 KB, text/plain)
2010-08-23 03:19 PDT, Ilya Tikhonovsky
no flags
[patch] second iteration. Rebaselined. (32.67 KB, patch)
2010-08-23 04:58 PDT, Ilya Tikhonovsky
yurys: review+
actually landed (32.83 KB, patch)
2010-08-23 07:38 PDT, Ilya Tikhonovsky
no flags
Ilya Tikhonovsky
Comment 1 2010-08-20 12:31:06 PDT
Created attachment 64973 [details] [patch] initial version.
Joseph Pecoraro
Comment 2 2010-08-20 12:48:35 PDT
Ilya, could you attach a generated version of InspectorBackendStub after you patch? Some minor comments after a glance. WebCore/inspector/CodeGeneratorInspector.pm:527 > + this[command] = this.sendMessageToBackend.bind(this, commandInfo); I think _registerDelegate should just take a single argument, commandInfo, and "command" is just "commandInfo.command". WebCore/inspector/CodeGeneratorInspector.pm:540 > + if (args.length == 1 && typeof args[0] === "function") Nit: ===
Ilya Tikhonovsky
Comment 3 2010-08-20 13:20:16 PDT
Created attachment 64978 [details] sample: InspectorBackendDispatcher.cpp
Ilya Tikhonovsky
Comment 4 2010-08-20 13:20:56 PDT
Created attachment 64979 [details] sample: InspectorBackendStub.js
Ilya Tikhonovsky
Comment 5 2010-08-20 13:21:31 PDT
Created attachment 64980 [details] sample: RemoteInspectorFrontend.cpp
Ilya Tikhonovsky
Comment 6 2010-08-20 13:25:39 PDT
(In reply to comment #2) > Ilya, could you attach a generated version of InspectorBackendStub after you patch? > Some minor comments after a glance. done > WebCore/inspector/CodeGeneratorInspector.pm:527 > > + this[command] = this.sendMessageToBackend.bind(this, commandInfo); > I think _registerDelegate should just take a single argument, commandInfo, and "command" is just "commandInfo.command". > WebCore/inspector/CodeGeneratorInspector.pm:540 > > + if (args.length == 1 && typeof args[0] === "function") > Nit: ===
WebKit Review Bot
Comment 7 2010-08-20 14:36:37 PDT
Yury Semikhatsky
Comment 8 2010-08-22 23:25:47 PDT
Comment on attachment 64973 [details] [patch] initial version. WebCore/inspector/CodeGeneratorInspector.pm:295 + push(@function, " RefPtr<InspectorObject> requestMessageObject(requestMessageObjectRef);"); This is not needed. WebCore/inspector/CodeGeneratorInspector.pm:511 + "\\\"arguments\\\": {$argumentNames}" . Unrelated to this issue, but it would be nice if we didn't escape quotes in the JSON strings in InspectorBackendStub.js but use single quotes instead( "\"property\"" -> '"property"') WebCore/inspector/front-end/inspector.js:637 + WebInspector.log("Error: InspectorBackend." + message.command + " failed."); These messages should go into console.error not the Inspector's console. WebCore/inspector/CodeGeneratorInspector.pm:354 + push(@function, " responseMessage->setString(\"type\", \"response\");"); It might make sense to extract these string constants and reuse them.
Ilya Tikhonovsky
Comment 9 2010-08-23 03:18:15 PDT
Created attachment 65096 [details] [patch] second iteration > WebCore/inspector/CodeGeneratorInspector.pm:527 > > + this[command] = this.sendMessageToBackend.bind(this, commandInfo); > I think _registerDelegate should just take a single argument, commandInfo, and "command" is just "commandInfo.command". done. > WebCore/inspector/CodeGeneratorInspector.pm:540 > > + if (args.length == 1 && typeof args[0] === "function") > Nit: === done. > WebCore/inspector/CodeGeneratorInspector.pm:295 > + push(@function, " RefPtr<InspectorObject> requestMessageObject(requestMessageObjectRef);"); > This is not needed. done > WebCore/inspector/CodeGeneratorInspector.pm:511 > + "\\\"arguments\\\": {$argumentNames}" . > Unrelated to this issue, but it would be nice if we didn't escape quotes in the JSON strings in InspectorBackendStub.js but use single quotes instead( "\"property\"" -> '"property"') done > WebCore/inspector/front-end/inspector.js:637 > + WebInspector.log("Error: InspectorBackend." + message.command + " failed."); > These messages should go into console.error not the Inspector's console. done > WebCore/inspector/CodeGeneratorInspector.pm:354 > + push(@function, " responseMessage->setString(\"type\", \"response\");"); > It might make sense to extract these string constants and reuse them. done InspectorFrontendClientLocal::setAttachedWindow was fixed. WebInspector_syncDispatch was fixed.
Ilya Tikhonovsky
Comment 10 2010-08-23 03:19:11 PDT
Created attachment 65097 [details] sample: InspectorBackendStub.js
Eric Seidel (no email)
Comment 11 2010-08-23 03:26:13 PDT
Early Warning System Bot
Comment 12 2010-08-23 03:27:27 PDT
WebKit Review Bot
Comment 13 2010-08-23 04:44:29 PDT
Ilya Tikhonovsky
Comment 14 2010-08-23 04:58:00 PDT
Created attachment 65103 [details] [patch] second iteration. Rebaselined.
Yury Semikhatsky
Comment 15 2010-08-23 05:06:41 PDT
Comment on attachment 65103 [details] [patch] second iteration. Rebaselined. WebCore/inspector/front-end/inspector.js:638 + console.log("Error: InspectorBackend." + messageObject.command + " failed."); console.log -> console.error
WebKit Review Bot
Comment 16 2010-08-23 05:13:01 PDT
Ilya Tikhonovsky
Comment 17 2010-08-23 05:15:04 PDT
Committed r65803 M WebCore/ChangeLog M WebCore/inspector/CodeGeneratorInspector.pm M WebCore/inspector/InspectorController.cpp M WebCore/inspector/InspectorFrontendClientLocal.cpp M WebCore/inspector/InspectorValues.h M WebCore/inspector/Inspector.idl M WebCore/inspector/front-end/inspector.js M WebCore/inspector/front-end/Callback.js M WebCore/inspector/InspectorController.h r65803 = f2ffcc11e3506172e312f7f20d457460ec35a38c (refs/remotes/trunk)
Ilya Tikhonovsky
Comment 18 2010-08-23 07:21:14 PDT
With fixed windows build Committed r65809 M WebCore/ChangeLog M WebCore/inspector/CodeGeneratorInspector.pm M WebCore/inspector/InspectorController.cpp M WebCore/inspector/InspectorFrontendClientLocal.cpp M WebCore/inspector/InspectorValues.h M WebCore/inspector/Inspector.idl M WebCore/inspector/front-end/inspector.js M WebCore/inspector/front-end/Callback.js M WebCore/inspector/InspectorController.h r65809 = 12044a8f1a0b8a82f217ae39411f717045555612 (refs/remotes/trunk)
Ilya Tikhonovsky
Comment 19 2010-08-23 07:38:21 PDT
Created attachment 65117 [details] actually landed
Note You need to log in before you can comment on or make changes to this bug.