Bug 28911 - WebInspector: serialize calls to InjectedScript with JSON.
Summary: WebInspector: serialize calls to InjectedScript with JSON.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (Deprecated) (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Pavel Feldman
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-09-02 09:39 PDT by Pavel Feldman
Modified: 2009-10-17 21:59 PDT (History)
2 users (show)

See Also:


Attachments
patch (21.81 KB, patch)
2009-09-02 09:42 PDT, Pavel Feldman
timothy: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Pavel Feldman 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.
Comment 1 Pavel Feldman 2009-09-02 09:42:27 PDT
Created attachment 38929 [details]
patch

I wonder how this JSON.stringify / JSON.parse slows things down.
Comment 2 Timothy Hatcher 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!
Comment 3 Pavel Feldman 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
Comment 4 Joseph Pecoraro 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.