RESOLVED FIXED Bug 28911
WebInspector: serialize calls to InjectedScript with JSON.
https://bugs.webkit.org/show_bug.cgi?id=28911
Summary WebInspector: serialize calls to InjectedScript with JSON.
Pavel Feldman
Reported 2009-09-02 09:39:38 PDT
I'd like to replace setTimeout delegates that DOMAgent adds into InspectorController with the following schema: new InjectedScriptAccess.js is added into the frontend. It is accessible from the rest of the frontend. This access class serializes all the calls and passes them into InspectorController. InspectorController is dispatching these calls on the InjectedScript. As a result, there is no direct interaction between the front-end and InjectedScript left. That is needed in order to host InjectedScript in a separate context.
Attachments
patch (21.81 KB, patch)
2009-09-02 09:42 PDT, Pavel Feldman
timothy: review+
Pavel Feldman
Comment 1 2009-09-02 09:42:27 PDT
Created attachment 38929 [details] patch I wonder how this JSON.stringify / JSON.parse slows things down.
Timothy Hatcher
Comment 2 2009-09-03 13:09:47 PDT
Comment on attachment 38929 [details] patch > + ScriptValue callFrames = function.call(); > + return callFrames.toString(m_inspectorController->m_scriptState); I think callFrames is a copy-and-paste error. This should have a different name. I see the light at the end of the tunnel!
Pavel Feldman
Comment 3 2009-09-04 02:05:17 PDT
Committing to http://svn.webkit.org/repository/webkit/trunk ... M WebCore/ChangeLog M WebCore/WebCore.gypi M WebCore/WebCore.vcproj/WebCore.vcproj M WebCore/inspector/InspectorBackend.cpp M WebCore/inspector/InspectorBackend.h M WebCore/inspector/InspectorBackend.idl M WebCore/inspector/InspectorFrontend.cpp M WebCore/inspector/InspectorFrontend.h M WebCore/inspector/front-end/ConsoleView.js M WebCore/inspector/front-end/DOMAgent.js M WebCore/inspector/front-end/ElementsPanel.js M WebCore/inspector/front-end/InjectedScript.js A WebCore/inspector/front-end/InjectedScriptAccess.js M WebCore/inspector/front-end/MetricsSidebarPane.js M WebCore/inspector/front-end/ObjectPropertiesSection.js M WebCore/inspector/front-end/PropertiesSidebarPane.js M WebCore/inspector/front-end/ResourcesPanel.js M WebCore/inspector/front-end/ScriptsPanel.js M WebCore/inspector/front-end/StylesSidebarPane.js M WebCore/inspector/front-end/inspector.html Committed r48046
Joseph Pecoraro
Comment 4 2009-10-17 21:59:54 PDT
Investigating something I noticed that I'm included in the copyright on InjectedScriptAccess.js (a new file added when this patch was landed). I assume that it was copied from an existing file at the time. I know that nothing I wrote contributed to this file. Should my name be removed? I don't mind if it stays or is removed, but I think to be the most accurate if it was removed. The license states that the copyright information should be carried with the license, however I can attest to the fact that it need not be here. Also, how rigorous is Apple or Google with respect to copyright years on files? For instance utilities.js has had a few >10 line updates since 2007. These incidents have convinced me to be more rigorous about updating copyright information before submitting a patch.
Note You need to log in before you can comment on or make changes to this bug.