Bug 81031 - Web Inspector: MainScriptMapping should detect snippet scripts by means of sourceURL set before evaluation.
: Web Inspector: MainScriptMapping should detect snippet scripts by means of so...
Status: RESOLVED FIXED
Product: WebKit
Classification: Unclassified
Component: Web Inspector (Deprecated)
: 528+ (Nightly build)
: All All
: P2 Normal
Assigned To: Vsevolod Vlasov
:
Depends on:
Blocks: 75094
  Show dependency treegraph
 
Reported: 2012-03-13 13:37 PDT by Vsevolod Vlasov
Modified: 2012-03-15 11:27 PDT (History)
11 users (show)

See Also:


Attachments
Patch (19.62 KB, patch)
2012-03-14 12:58 PDT, Vsevolod Vlasov
no flags Details | Formatted Diff | Diff
Patch (19.87 KB, patch)
2012-03-14 13:01 PDT, Vsevolod Vlasov
no flags Details | Formatted Diff | Diff
Patch (20.11 KB, patch)
2012-03-15 09:15 PDT, Vsevolod Vlasov
no flags Details | Formatted Diff | Diff
Patch (20.07 KB, patch)
2012-03-15 10:17 PDT, Vsevolod Vlasov
pfeldman: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Vsevolod Vlasov 2012-03-13 13:37:04 PDT
MainScriptMapping should detect snippet scripts by means of sourceURL set before evaluation.
Comment 1 Vsevolod Vlasov 2012-03-14 12:58:41 PDT
Created attachment 131901 [details]
Patch
Comment 2 Vsevolod Vlasov 2012-03-14 13:01:17 PDT
Created attachment 131902 [details]
Patch
Comment 3 Vsevolod Vlasov 2012-03-14 16:06:40 PDT
podivilov@, could you please take a look?
Comment 4 Pavel Podivilov 2012-03-15 02:27:06 PDT
Comment on attachment 131902 [details]
Patch

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

> Source/WebCore/inspector/front-end/SnippetsModel.js:140
> +        var sourceURL = this.sourceURLForSnippet(snippet, evaluationIndex);

Please inline sourceURLForSnippet here and set snippet.sourceURL = sourceURL.

> Source/WebCore/inspector/front-end/SnippetsModel.js:153
> +        for (var i = 0; i < this._snippets.length; ++i) {

Why not making this._snippets a map?

> Source/WebCore/inspector/front-end/SnippetsModel.js:192
> +        var snippetId = this.snippetIdForSourceURL(sourceURL);

Please inline snippetIdForSourceURL here.

> Source/WebCore/inspector/front-end/SnippetsModel.js:240
> +    get lastEvaluationSourceURL()

Please remove this public getter, all you need is a private field that is used solely by SnippetModel.

> Source/WebCore/inspector/front-end/SnippetsModel.js:414
> +        uiSourceCode.snippet = snippet;

This looks wrong.
Comment 5 Vsevolod Vlasov 2012-03-15 09:15:10 PDT
Created attachment 132060 [details]
Patch
Comment 6 Pavel Podivilov 2012-03-15 10:12:20 PDT
Comment on attachment 132060 [details]
Patch

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

looks good!

> Source/WebCore/inspector/front-end/SnippetsModel.js:153
>      snippetIdForSourceURL: function(sourceURL)

Please make it private.
Comment 7 Vsevolod Vlasov 2012-03-15 10:17:21 PDT
Created attachment 132068 [details]
Patch
Comment 8 Vsevolod Vlasov 2012-03-15 10:46:00 PDT
> > Source/WebCore/inspector/front-end/SnippetsModel.js:153
> >      snippetIdForSourceURL: function(sourceURL)
> 
> Please make it private.

It is used in MainScriptMapping to detect snippet scripts.
Comment 9 Vsevolod Vlasov 2012-03-15 11:27:02 PDT
Committed r110864: <http://trac.webkit.org/changeset/110864>