Bug 33523 - [V8] Support injection of inspector scripts into the inspected context
Summary: [V8] Support injection of inspector scripts into the inspected context
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: Yury Semikhatsky
URL:
Keywords:
Depends on:
Blocks: 32554
  Show dependency treegraph
 
Reported: 2010-01-12 00:29 PST by Yury Semikhatsky
Modified: 2010-01-12 04:42 PST (History)
3 users (show)

See Also:


Attachments
patch (5.53 KB, patch)
2010-01-12 00:46 PST, Yury Semikhatsky
no flags Details | Formatted Diff | Diff
patch (5.46 KB, patch)
2010-01-12 01:23 PST, Yury Semikhatsky
pfeldman: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Yury Semikhatsky 2010-01-12 00:29:26 PST
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).
Comment 1 Yury Semikhatsky 2010-01-12 00:46:12 PST
Created attachment 46347 [details]
patch
Comment 2 WebKit Review Bot 2010-01-12 00:50:11 PST
Attachment 46347 [details] did not build on chromium:
Build output: http://webkit-commit-queue.appspot.com/results/182350
Comment 3 Yury Semikhatsky 2010-01-12 01:23:46 PST
Created attachment 46349 [details]
patch
Comment 4 Pavel Feldman 2010-01-12 01:53:28 PST
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.
Comment 5 Yury Semikhatsky 2010-01-12 02:50:06 PST
(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.
Comment 6 Yury Semikhatsky 2010-01-12 04:42:17 PST
Committing to http://svn.webkit.org/repository/webkit/trunk ...
	M	WebCore/ChangeLog
	M	WebCore/bindings/v8/custom/V8InjectedScriptHostCustom.cpp
Committed r53135