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.
Created attachment 162053 [details] Patch
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)
Created attachment 162429 [details] Patch
Committed r127705: <http://trac.webkit.org/changeset/127705>