Bug 52652 - Web Inspector: make InjectedScriptAccess API a part of Web Inspector protocol.
Summary: Web Inspector: make InjectedScriptAccess API a part of Web Inspector protocol.
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: 2011-01-18 12:50 PST by Pavel Feldman
Modified: 2011-01-19 06:09 PST (History)
13 users (show)

See Also:


Attachments
[PATCH] Proposed change. (51.04 KB, patch)
2011-01-18 13:17 PST, Pavel Feldman
no flags Details | Formatted Diff | Diff
[PATCH] Proposed change with passing tests now. (57.93 KB, patch)
2011-01-18 23:09 PST, Pavel Feldman
yurys: 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 2011-01-18 12:50:37 PST
Calls served by the InjectedScript should be first class protocol citizens, not dispatched via single protocol message.
Comment 1 Pavel Feldman 2011-01-18 13:17:15 PST
Created attachment 79319 [details]
[PATCH] Proposed change.

I am still nailing down couple of tests, but I think it is ready for review.
Comment 2 WebKit Review Bot 2011-01-18 13:19:50 PST
Attachment 79319 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'LayoutTests/ChangeLog', u'LayoutTests/http..." exit_code: 1

Source/WebCore/inspector/InjectedScript.h:77:  The parameter name "function" adds no information, so it should be removed.  [readability/parameter_name] [5]
Total errors found: 1 in 24 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Pavel Feldman 2011-01-18 23:09:00 PST
Created attachment 79393 [details]
[PATCH] Proposed change with passing tests now.
Comment 4 Yury Semikhatsky 2011-01-19 00:13:55 PST
Comment on attachment 79393 [details]
[PATCH] Proposed change with passing tests now.

View in context: https://bugs.webkit.org/attachment.cgi?id=79393&action=review

> Source/WebCore/inspector/InjectedScript.cpp:167
> +    if (hasNoValue() || !canAccessInspectedWindow()) {

Is there a valid scenario where hasNoValue() == true ?

> Source/WebCore/inspector/InjectedScriptHost.h:114
> +    InjectedScript injectedScriptForMainWorld();

injectedScriptForMainWorld -> injectedScriptForMainFrame, we don't create injected scripts for non-main worlds.

> Source/WebCore/inspector/InjectedScriptSource.js:195
> +            if (callFrameId >= 0) {

I'd rather use callFrameId !== -1 since there no frames with negative ids.

> Source/WebCore/inspector/InjectedScriptSource.js:330
> +    getNodePrototypes: function(nodeId)

Why did this method move?

> Source/WebCore/inspector/Inspector.idl:77
> +        [domain=InjectedScript] void evaluate(in String expression, in String objectGroup, out Value result);

Either both or none of evaluate & evaluateInCallFrame should accept injectedScriptId for consistency.

> Source/WebCore/inspector/front-end/ExtensionServer.js:275
> +        InspectorBackend.evaluate(evalExpression, "none", callback.bind(this));

none -> extension?
Comment 5 Pavel Feldman 2011-01-19 01:02:19 PST
Committed r76105: <http://trac.webkit.org/changeset/76105>
Comment 6 WebKit Review Bot 2011-01-19 06:09:12 PST
http://trac.webkit.org/changeset/76105 might have broken SnowLeopard Intel Release (Tests)
The following tests are not passing:
http/tests/inspector/extensions-resources-redirect.html