Part of Web Inspector is implemented in JavaScript and needs direct access to the inspected JS objects. To facilitate this there should be a way to compile the inspector utilities(called injected script) in the global scope of the inspected ScriptState and somehow store a reference to it(we need to keep the reference since the injected script keeps some state related to the inspected DOM, CSS styles and JS objects).
Created attachment 46347 [details] patch
Attachment 46347 [details] did not build on chromium: Build output: http://webkit-commit-queue.appspot.com/results/182350
Created attachment 46349 [details] patch
Comment on attachment 46349 [details] patch > + // Create a weak reference to the v8 wrapper of InspectorBackend to deref > + // InspectorBackend when the wrapper is garbage collected. InspectorBackend? > + // Call custom code to create inspector backend wrapper in the utility context inspector backend wrapper ? > + ASSERT(!v.IsEmpty()); > + ASSERT(v->IsFunction()); > + So this script source should evaluate into function? Could you on comment why it is so? Otherwise looks good.
(In reply to comment #4) > (From update of attachment 46349 [details]) > > + // Create a weak reference to the v8 wrapper of InspectorBackend to deref > > + // InspectorBackend when the wrapper is garbage collected. > > InspectorBackend? > Done. Changed to InjectedScriptHost. > > + // Call custom code to create inspector backend wrapper in the utility context > > inspector backend wrapper ? > Fixed. > > + ASSERT(!v.IsEmpty()); > > + ASSERT(v->IsFunction()); > > + > > So this script source should evaluate into function? Could you on comment why > it is so? > Done.
Committing to http://svn.webkit.org/repository/webkit/trunk ... M WebCore/ChangeLog M WebCore/bindings/v8/custom/V8InjectedScriptHostCustom.cpp Committed r53135