Bug 95752 - Web Inspector: Fix inconsistencies in NetworkUISourceCodeProvider implementation.
Summary: Web Inspector: Fix inconsistencies in NetworkUISourceCodeProvider implementat...
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: Vsevolod Vlasov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-09-04 08:32 PDT by Vsevolod Vlasov
Modified: 2012-09-06 00:40 PDT (History)
10 users (show)

See Also:


Attachments
Patch (28.15 KB, patch)
2012-09-04 09:39 PDT, Vsevolod Vlasov
no flags Details | Formatted Diff | Diff
Patch (28.11 KB, patch)
2012-09-05 23:55 PDT, Vsevolod Vlasov
apavlov: 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-09-04 08:32:40 PDT
NetworkUISourceCodeProvider should not receive ResourceAdded event until resource was finished.
StyleSourceMapping should listen for workspace event instead of being called directly by NetworkUISourceCodeProvider.
ProjectDidReset event should be introduced instead of setTimeout hacks in mappings.

Patch to follow.
Comment 1 Vsevolod Vlasov 2012-09-04 09:39:56 PDT
Created attachment 162053 [details]
Patch
Comment 2 Alexander Pavlov (apavlov) 2012-09-05 23:45:28 PDT
Comment on attachment 162053 [details]
Patch

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

> Source/WebCore/ChangeLog:8
> +        NetworkUISourceCodeProvider does not receive ResourceAdded event until resource was finished anymore.

was -> is (or "has been")

> Source/WebCore/ChangeLog:9
> +        StyleSourceMapping now listens for workspace event instead of being called directly by NetworkUISourceCodeProvider.

StylesSourceMapping

> Source/WebCore/ChangeLog:10
> +        StyleSourceMapping is now created from inspector.js.

ditto

> Source/WebCore/inspector/front-end/NetworkUISourceCodeProvider.js:72
> +            var uiSourceCode = new WebInspector.StyleSource(resource);

Duplicate "var uiSourceCode" declaration

> Source/WebCore/inspector/front-end/NetworkUISourceCodeProvider.js:75
> +            var uiSourceCode = new WebInspector.JavaScriptSource(resource.url, resource, resource, false);

ditto

> Source/WebCore/inspector/front-end/NetworkUISourceCodeProvider.js:78
> +            var uiSourceCode = new WebInspector.JavaScriptSource(resource.url, resource, resource, true);

You can unify the two cases by using "resource.type === WebInspector.resourceTypes.Script" as the last argument

> LayoutTests/inspector/debugger/network-uisourcecode-provider.html:10
> +    var lastResouceId = 0;

Let's fix the name while we are here - "lastResourceId".

> LayoutTests/inspector/debugger/script-snippet-model.html:8
> +setTimeout(InspectorTest.completeTest.bind(InspectorTest), 1000);

???

> LayoutTests/inspector/debugger/script-snippet-model.html:36
> +                InspectorTest.assertEquals(workspace.uiSourceCodes().length, 1, "Only one snippet uiSourceCode should be present after project navigation.");

(expected, found, message)
Comment 3 Vsevolod Vlasov 2012-09-05 23:55:33 PDT
Created attachment 162429 [details]
Patch
Comment 4 Vsevolod Vlasov 2012-09-06 00:40:38 PDT
Committed r127705: <http://trac.webkit.org/changeset/127705>