Bug 106795 - Web Inspector: Introduce file mapping allowing to map network loaded scripts and stylesheets to file system files.
Summary: Web Inspector: Introduce file mapping allowing to map network loaded scripts ...
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
Depends on:
Reported: 2013-01-14 07:43 PST by Vsevolod Vlasov
Modified: 2013-01-16 02:28 PST (History)
8 users (show)

See Also:

Patch (40.02 KB, patch)
2013-01-14 08:43 PST, Vsevolod Vlasov
no flags Details | Formatted Diff | Diff
Patch (36.34 KB, patch)
2013-01-15 08:33 PST, 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 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]
Comment 2 Pavel Feldman 2013-01-14 09:02:10 PST
Comment on attachment 182583 [details]

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]
Comment 4 Pavel Feldman 2013-01-16 01:27:38 PST
Comment on attachment 182781 [details]

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>