Bug 106795

Summary: Web Inspector: Introduce file mapping allowing to map network loaded scripts and stylesheets to file system files.
Product: WebKit Reporter: Vsevolod Vlasov <vsevik>
Component: Web Inspector (Deprecated)Assignee: Vsevolod Vlasov <vsevik>
Status: RESOLVED FIXED    
Severity: Normal CC: apavlov, keishi, loislo, pfeldman, pmuellr, vsevik, web-inspector-bugs, yurys
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
Patch
none
Patch pfeldman: review+

Description Vsevolod Vlasov 2013-01-14 07:43:41 PST
Introduced file mapping for inspector.
FileMapping is essentially an array of MappingEntries where each MappingEntry is a pair of urlPrefix and pathPrefix.
When scripts and stylesheets are mapped to uiSourceCodes FileMapping methods are used to establish prefix based matching with file system uiSourceCodes if possible.
Comment 1 Vsevolod Vlasov 2013-01-14 08:43:32 PST
Created attachment 182583 [details]
Patch
Comment 2 Pavel Feldman 2013-01-14 09:02:10 PST
Comment on attachment 182583 [details]
Patch

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

> Source/WebCore/inspector/front-end/BreakpointManager.js:453
> +            var url = WebInspector.fileMapping.urlForUISourceCode(this._primaryUILocation.uiSourceCode);

I think I like it more the way it was before. I.e. if each UISourceCode has exactly one (or zero) URLs and that URL does not change during the UISourceCode lifetime, why not to store it internally? External mapping just adds indirection. Look at the way you bloat the code.
Comment 3 Vsevolod Vlasov 2013-01-15 08:33:09 PST
Created attachment 182781 [details]
Patch
Comment 4 Pavel Feldman 2013-01-16 01:27:38 PST
Comment on attachment 182781 [details]
Patch

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

> LayoutTests/inspector/file-mapping.html:40
> +    InspectorTest.assertEquals(fileMapping.uriForURL("http://www.example.com"), "uri:/home/example.com", "fileMapping.uriForURL failed.");

Please never use assertEquals, do InspectorTest.addResult(fileMapping.uriForURL("http://www.example.com")) instead; It greatly improves debuggability.
Comment 5 Vsevolod Vlasov 2013-01-16 02:28:07 PST
Committed r139860: <http://trac.webkit.org/changeset/139860>