Bug 86477 - Web Inspector: Refactor SnippetsModel: extract SnippetStorage, make SnippetScriptMapping delegate calls to ScriptSnippetModel and provide public interface on ScriptSnippetModel in terms of uiSourceCodes
Summary: Web Inspector: Refactor SnippetsModel: extract SnippetStorage, make SnippetSc...
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-05-15 06:30 PDT by Vsevolod Vlasov
Modified: 2012-05-15 07:36 PDT (History)
10 users (show)

See Also:


Attachments
Patch (63.27 KB, patch)
2012-05-15 06:34 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-05-15 06:30:52 PDT
Refactor SnippetsModel: extract SnippetStorage, make SnippetScriptMapping delegate calls to ScriptSnippetModel and provide public interface on ScriptSnippetModel in terms of uiSourceCodes
Comment 1 Vsevolod Vlasov 2012-05-15 06:34:05 PDT
Created attachment 141950 [details]
Patch
Comment 2 Pavel Feldman 2012-05-15 06:51:29 PDT
Comment on attachment 141950 [details]
Patch

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

> Source/WebCore/inspector/front-end/DebuggerPresentationModel.js:-44
> -    this._mappings.push(this._snippetsMapping);

Now that DPM is only instantiating mappings, I don't see a problem in its dependency on snippets model.

> Source/WebCore/inspector/front-end/DebuggerPresentationModel.js:106
> +    set snippetMapping(snippetMapping)

Setters do not work great with the compiler, avoid their use.

> Source/WebCore/inspector/front-end/ScriptSnippetModel.js:75
> +        var uiSourceCode = new WebInspector.JavaScriptSource(uiSourceCodeURL, new WebInspector.SnippetContentProvider(snippet), this._snippetScriptMapping);

could snippet implement ContentProvider ?

> Source/WebCore/inspector/front-end/ScriptSnippetModel.js:89
> +        var snippet = this._snippetForUISourceCode.get(uiSourceCode);

I don't think one can follow consistency of these maps.
Comment 3 Vsevolod Vlasov 2012-05-15 07:36:18 PDT
Committed r117065: <http://trac.webkit.org/changeset/117065>