-
vsevik@chromium.org authored
Web Inspector: Refactor SnippetsModel: extract SnippetStorage, make SnippetScriptMapping delegate calls to ScriptSnippetModel and provide public interface on ScriptSnippetModel in terms of uiSourceCodes https://bugs.webkit.org/show_bug.cgi?id=86477 Reviewed by Pavel Feldman. Source/WebCore: Extracted SnippetStorage to be reused for other snippet types. Made SnippetScriptMapping delegate all calls to ScriptSnippetModel and injected it in DebuggerPresentationModel. ScriptSnippetModel now provides public interface for ScriptsPanel in terms of uiSourceCodes. Tests: inspector/debugger/script-snippet-model.html inspector/snippet-storage.html * WebCore.gypi: * WebCore.vcproj/WebCore.vcproj: * inspector/compile-front-end.py: * inspector/front-end/DebuggerPresentationModel.js: (WebInspector.DebuggerPresentationModel): * inspector/front-end/ScriptSnippetModel.js: Added. (WebInspector.ScriptSnippetModel): (WebInspector.ScriptSnippetModel.prototype.get scriptMapping): (WebInspector.ScriptSnippetModel.prototype.createScriptSnippet): (WebInspector.ScriptSnippetModel.prototype._addScriptSnippet): (WebInspector.ScriptSnippetModel.prototype._rawLocationToUILocation): (WebInspector.ScriptSnippetModel.prototype._uiLocationToRawLocation.get if): (WebInspector.ScriptSnippetModel.prototype._uiLocationToRawLocation): (WebInspector.ScriptSnippetModel.prototype._uiSourceCodeList): (WebInspector.ScriptSnippetModel.prototype._releasedUISourceCodes): (WebInspector.ScriptSnippetModel.prototype._createUISourceCodeForScript): (WebInspector.ScriptSnippetModel.prototype._sourceURLForSnippet): (WebInspector.ScriptSnippetModel.prototype._snippetIdForSourceURL): (WebInspector.ScriptSnippetModel.prototype._snippetForSourceURL): (WebInspector.ScriptSnippetModel.prototype._reset): (WebInspector.SnippetScriptMapping): (WebInspector.SnippetScriptMapping.prototype.rawLocationToUILocation): (WebInspector.SnippetScriptMapping.prototype.uiLocationToRawLocation): (WebInspector.SnippetScriptMapping.prototype.uiSourceCodeList): (WebInspector.SnippetScriptMapping.prototype.snippetIdForSourceURL): (WebInspector.SnippetScriptMapping.prototype.addScript): (WebInspector.SnippetScriptMapping.prototype._uiSourceCodesAdded): (WebInspector.SnippetScriptMapping.prototype._uiSourceCodesRemoved): (WebInspector.SnippetScriptMapping.prototype.reset): (WebInspector.SnippetContentProvider): * inspector/front-end/SnippetStorage.js: Added. (WebInspector.SnippetStorage): (WebInspector.SnippetStorage.prototype.get namePrefix): (WebInspector.SnippetStorage.prototype._saveSettings): (WebInspector.SnippetStorage.prototype.set snippets): (WebInspector.SnippetStorage.prototype.snippetForId): (WebInspector.SnippetStorage.prototype.deleteSnippet): (WebInspector.SnippetStorage.prototype._snippetAdded): (WebInspector.SnippetStorage.prototype.reset.set this): (WebInspector.Snippet): (WebInspector.Snippet.fromObject): (WebInspector.Snippet.prototype.get id): (WebInspector.Snippet.prototype.get name): (WebInspector.Snippet.prototype.set name): (WebInspector.Snippet.prototype.get content): (WebInspector.Snippet.prototype.set content): (WebInspector.Snippet.prototype.serializeToObject): * inspector/front-end/SnippetsModel.js: Removed. * inspector/front-end/WebKit.qrc: * inspector/front-end/inspector.html: * inspector/front-end/inspector.js: LayoutTests: * inspector/debugger/script-snippet-model-expected.txt: Added. * inspector/debugger/script-snippet-model.html: Added. * inspector/debugger/snippets-model-expected.txt: Removed. * inspector/debugger/snippets-model.html: Removed. * inspector/snippet-storage-expected.txt: Added. * inspector/snippet-storage.html: Added. git-svn-id: http://svn.webkit.org/repository/webkit/trunk@117065 268f45cc-cd09-0410-ab3c-d52691b4dbfc
b7e7c9d7