RESOLVED FIXED 34204
Web Inspector: Migrate from ScriptObject to InspectorValue as the InspectorFrontend / backend interchange object.
https://bugs.webkit.org/show_bug.cgi?id=34204
Summary Web Inspector: Migrate from ScriptObject to InspectorValue as the InspectorFr...
Pavel Feldman
Reported 2010-01-27 00:36:13 PST
Currently InjectedScript operates ScriptValue/Object and is running within inspected page's context. It is safe to pass objects between injected script and the page. Frontend is running in its own context, entirely isolated from the inspected page. We should make sure that JS objects do not cross the boundary and I suggest that we enforce it via introducing explicit FrontendValue/Object classes (derived from ScriptValue/Object). InspectorFrontend then will only accept objects of this type.
Attachments
[WIP Patch] Handing over to Ilya. (133.16 KB, patch)
2010-05-14 06:54 PDT, Pavel Feldman
no flags
[patch] initial version. (32.22 KB, patch)
2010-05-24 05:19 PDT, Ilya Tikhonovsky
no flags
[patch] Classes for native serialization to JSON. (20.15 KB, patch)
2010-05-31 06:56 PDT, Ilya Tikhonovsky
pfeldman: review+
[patch] second iteration (20.09 KB, patch)
2010-05-31 07:30 PDT, Ilya Tikhonovsky
no flags
[patch] third iteration. With fixes for linux build. (20.09 KB, patch)
2010-05-31 07:39 PDT, Ilya Tikhonovsky
no flags
[patch] fourth iteration. With fixed mac export list. (19.69 KB, patch)
2010-05-31 07:53 PDT, Ilya Tikhonovsky
no flags
Pavel Feldman
Comment 1 2010-05-14 06:54:54 PDT
Created attachment 56066 [details] [WIP Patch] Handing over to Ilya.
Ilya Tikhonovsky
Comment 2 2010-05-24 05:19:50 PDT
Created attachment 56874 [details] [patch] initial version. It is the first patch with implementation for InspectorValues classes. The changes for TimelineAgent, DOMAgent etc. will be processed separately.
Yury Semikhatsky
Comment 3 2010-05-24 06:00:36 PDT
Comment on attachment 56874 [details] [patch] initial version. WebCore/inspector/InspectorFrontend.h:53 + virtual void dispatchMessageToInspector(const String& message) = 0; We already have InspectorFrontendClient which serves as the frontend delegate, this method should go there. WebCore/inspector/InspectorValues.cpp:43 + JSONBuffer(size_t preallocate) : m_position(0), m_buffer(preallocate) { } Should be possible to use Vector instead of this class, it has capacity in addition to size. The only issue there may be fixed resize strategy. WebCore/inspector/InspectorValues.h:117 + explicit InspectorValue(bool value) : InspectorBaseValue(TypeBoolean) { m_boolValue = value; } should other constructors be explicit? WebCore/inspector/InspectorValues.h:103 + class InspectorValue : public InspectorBaseValue { I think this should be InspectorPromitiveValue or something, InspectorValue is too generic. Can we have tests for the JSON stuff?
Ilya Tikhonovsky
Comment 4 2010-05-31 06:56:02 PDT
Created attachment 57459 [details] [patch] Classes for native serialization to JSON.
Pavel Feldman
Comment 5 2010-05-31 07:10:24 PDT
Comment on attachment 57459 [details] [patch] Classes for native serialization to JSON. WebCore/inspector/InspectorValues.h:47 + class InspectorBaseValue : public RefCounted<InspectorBaseValue> { InspectorValue WebCore/inspector/InspectorValues.h:78 + class InspectorValue : public InspectorBaseValue { InspectorBasicValue?
Early Warning System Bot
Comment 6 2010-05-31 07:11:38 PDT
WebKit Review Bot
Comment 7 2010-05-31 07:29:31 PDT
Ilya Tikhonovsky
Comment 8 2010-05-31 07:30:40 PDT
Created attachment 57461 [details] [patch] second iteration InspectorValue -> InspectorBasicValue InspectorBaseValue -> InspectorValue
Eric Seidel (no email)
Comment 9 2010-05-31 07:36:09 PDT
WebKit Review Bot
Comment 10 2010-05-31 07:39:47 PDT
Ilya Tikhonovsky
Comment 11 2010-05-31 07:39:49 PDT
Created attachment 57463 [details] [patch] third iteration. With fixes for linux build.
Eric Seidel (no email)
Comment 12 2010-05-31 07:42:54 PDT
WebKit Review Bot
Comment 13 2010-05-31 07:51:30 PDT
Ilya Tikhonovsky
Comment 14 2010-05-31 07:53:08 PDT
Created attachment 57466 [details] [patch] fourth iteration. With fixed mac export list.
WebKit Commit Bot
Comment 15 2010-05-31 15:28:41 PDT
Comment on attachment 57466 [details] [patch] fourth iteration. With fixed mac export list. Clearing flags on attachment: 57466 Committed r60452: <http://trac.webkit.org/changeset/60452>
WebKit Commit Bot
Comment 16 2010-05-31 15:28:50 PDT
All reviewed patches have been landed. Closing bug.
Joseph Pecoraro
Comment 17 2010-06-03 13:29:12 PDT
Comment on attachment 57466 [details] [patch] fourth iteration. With fixed mac export list. > +++ b/WebCore/inspector/InspectorValues.cpp > + result.reserveCapacity(512); For my education, was there any particular surrounding the decision for 512? > +++ b/WebCore/inspector/InspectorValues.h > + unsigned length() { return m_data.size(); } I think this can this be const: unsigned length() const { ... } Otherwise really well done.This looks very clean!
Note You need to log in before you can comment on or make changes to this bug.