Changeset 117065 in webkit


Ignore:
Timestamp:
May 15, 2012 7:37:01 AM (12 years ago)
Author:
vsevik@chromium.org
Message:

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.
Location:
trunk
Files:
6 added
3 deleted
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r117063 r117065  
     12012-05-15  Vsevolod Vlasov  <vsevik@chromium.org>
     2
     3        Web Inspector: Refactor SnippetsModel: extract SnippetStorage, make SnippetScriptMapping delegate calls to ScriptSnippetModel and provide public interface on ScriptSnippetModel in terms of uiSourceCodes
     4        https://bugs.webkit.org/show_bug.cgi?id=86477
     5
     6        Reviewed by Pavel Feldman.
     7
     8        * inspector/debugger/script-snippet-model-expected.txt: Added.
     9        * inspector/debugger/script-snippet-model.html: Added.
     10        * inspector/debugger/snippets-model-expected.txt: Removed.
     11        * inspector/debugger/snippets-model.html: Removed.
     12        * inspector/snippet-storage-expected.txt: Added.
     13        * inspector/snippet-storage.html: Added.
     14
    1152012-05-15  Csaba Osztrogonác  <ossy@webkit.org>
    216
  • trunk/Source/WebCore/ChangeLog

    r117064 r117065  
     12012-05-15  Vsevolod Vlasov  <vsevik@chromium.org>
     2
     3        Web Inspector: Refactor SnippetsModel: extract SnippetStorage, make SnippetScriptMapping delegate calls to ScriptSnippetModel and provide public interface on ScriptSnippetModel in terms of uiSourceCodes
     4        https://bugs.webkit.org/show_bug.cgi?id=86477
     5
     6        Reviewed by Pavel Feldman.
     7
     8        Extracted SnippetStorage to be reused for other snippet types.
     9        Made SnippetScriptMapping delegate all calls to ScriptSnippetModel and injected it in DebuggerPresentationModel.
     10        ScriptSnippetModel now provides public interface for ScriptsPanel in terms of uiSourceCodes.
     11
     12        Tests: inspector/debugger/script-snippet-model.html
     13               inspector/snippet-storage.html
     14
     15        * WebCore.gypi:
     16        * WebCore.vcproj/WebCore.vcproj:
     17        * inspector/compile-front-end.py:
     18        * inspector/front-end/DebuggerPresentationModel.js:
     19        (WebInspector.DebuggerPresentationModel):
     20        * inspector/front-end/ScriptSnippetModel.js: Added.
     21        (WebInspector.ScriptSnippetModel):
     22        (WebInspector.ScriptSnippetModel.prototype.get scriptMapping):
     23        (WebInspector.ScriptSnippetModel.prototype.createScriptSnippet):
     24        (WebInspector.ScriptSnippetModel.prototype._addScriptSnippet):
     25        (WebInspector.ScriptSnippetModel.prototype._rawLocationToUILocation):
     26        (WebInspector.ScriptSnippetModel.prototype._uiLocationToRawLocation.get if):
     27        (WebInspector.ScriptSnippetModel.prototype._uiLocationToRawLocation):
     28        (WebInspector.ScriptSnippetModel.prototype._uiSourceCodeList):
     29        (WebInspector.ScriptSnippetModel.prototype._releasedUISourceCodes):
     30        (WebInspector.ScriptSnippetModel.prototype._createUISourceCodeForScript):
     31        (WebInspector.ScriptSnippetModel.prototype._sourceURLForSnippet):
     32        (WebInspector.ScriptSnippetModel.prototype._snippetIdForSourceURL):
     33        (WebInspector.ScriptSnippetModel.prototype._snippetForSourceURL):
     34        (WebInspector.ScriptSnippetModel.prototype._reset):
     35        (WebInspector.SnippetScriptMapping):
     36        (WebInspector.SnippetScriptMapping.prototype.rawLocationToUILocation):
     37        (WebInspector.SnippetScriptMapping.prototype.uiLocationToRawLocation):
     38        (WebInspector.SnippetScriptMapping.prototype.uiSourceCodeList):
     39        (WebInspector.SnippetScriptMapping.prototype.snippetIdForSourceURL):
     40        (WebInspector.SnippetScriptMapping.prototype.addScript):
     41        (WebInspector.SnippetScriptMapping.prototype._uiSourceCodesAdded):
     42        (WebInspector.SnippetScriptMapping.prototype._uiSourceCodesRemoved):
     43        (WebInspector.SnippetScriptMapping.prototype.reset):
     44        (WebInspector.SnippetContentProvider):
     45        * inspector/front-end/SnippetStorage.js: Added.
     46        (WebInspector.SnippetStorage):
     47        (WebInspector.SnippetStorage.prototype.get namePrefix):
     48        (WebInspector.SnippetStorage.prototype._saveSettings):
     49        (WebInspector.SnippetStorage.prototype.set snippets):
     50        (WebInspector.SnippetStorage.prototype.snippetForId):
     51        (WebInspector.SnippetStorage.prototype.deleteSnippet):
     52        (WebInspector.SnippetStorage.prototype._snippetAdded):
     53        (WebInspector.SnippetStorage.prototype.reset.set this):
     54        (WebInspector.Snippet):
     55        (WebInspector.Snippet.fromObject):
     56        (WebInspector.Snippet.prototype.get id):
     57        (WebInspector.Snippet.prototype.get name):
     58        (WebInspector.Snippet.prototype.set name):
     59        (WebInspector.Snippet.prototype.get content):
     60        (WebInspector.Snippet.prototype.set content):
     61        (WebInspector.Snippet.prototype.serializeToObject):
     62        * inspector/front-end/SnippetsModel.js: Removed.
     63        * inspector/front-end/WebKit.qrc:
     64        * inspector/front-end/inspector.html:
     65        * inspector/front-end/inspector.js:
     66
    1672012-05-15  Pavel Feldman  <pfeldman@chromium.org>
    268
  • trunk/Source/WebCore/WebCore.gypi

    r117055 r117065  
    64656465            'inspector/front-end/ScriptFormatterWorker.js',
    64666466            'inspector/front-end/ScriptMapping.js',
     6467            'inspector/front-end/ScriptSnippetModel.js',
    64676468            'inspector/front-end/ScriptsNavigator.js',
    64686469            'inspector/front-end/ScriptsPanel.js',
     
    64776478            'inspector/front-end/SidebarPane.js',
    64786479            'inspector/front-end/SidebarTreeElement.js',
    6479             'inspector/front-end/SnippetsModel.js',
     6480            'inspector/front-end/SnippetStorage.js',
    64806481            'inspector/front-end/SoftContextMenu.js',
    64816482            'inspector/front-end/SourceCSSTokenizer.js',
  • trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj

    r117029 r117065  
    7470674706                                </File>
    7470774707                                <File
     74708                                        RelativePath="..\inspector\front-end\ScriptSnippetModel.js"
     74709                                        >
     74710                                </File>
     74711                                <File
    7470874712                                        RelativePath="..\inspector\front-end\scriptsPanel.css"
    7470974713                                        >
     
    7475474758                                </File>
    7475574759                                <File
    74756                                         RelativePath="..\inspector\front-end\SnippetsModel.js"
     74760                                        RelativePath="..\inspector\front-end\SnippetStorage.js"
    7475774761                                        >
    7475874762                                </File>
  • trunk/Source/WebCore/inspector/compile-front-end.py

    r116843 r117065  
    8585            "ScriptFormatter.js",
    8686            "ScriptMapping.js",
    87             "SnippetsModel.js",
     87            "ScriptSnippetModel.js",
     88            "SnippetStorage.js",
    8889            "TimelineManager.js",
    8990            "TimelineModel.js",
  • trunk/Source/WebCore/inspector/front-end/DebuggerPresentationModel.js

    r116843 r117065  
    4141    this._compilerMapping = new WebInspector.CompilerScriptMapping();
    4242    this._mappings.push(this._compilerMapping);
    43     this._snippetsMapping = new WebInspector.SnippetsScriptMapping();
    44     this._mappings.push(this._snippetsMapping);
     43    this._snippetMapping = WebInspector.scriptSnippetModel.scriptMapping;
     44    this._mappings.push(this._snippetMapping);
    4545 
    4646    for (var i = 0; i < this._mappings.length; ++i)
     
    110110    {
    111111        if (WebInspector.experimentsSettings.snippetsSupport.isEnabled()) {
    112             if (WebInspector.snippetsModel.snippetIdForSourceURL(script.sourceURL))
    113                 return this._snippetsMapping;
     112            if (this._snippetMapping && this._snippetMapping.snippetIdForSourceURL(script.sourceURL))
     113                return this._snippetMapping;
    114114        }
    115115
  • trunk/Source/WebCore/inspector/front-end/WebKit.qrc

    r117055 r117065  
    133133    <file>ScriptFormatterWorker.js</file>
    134134    <file>ScriptMapping.js</file>
     135    <file>ScriptSnippetModel.js</file>
    135136    <file>ScriptsPanel.js</file>
    136137    <file>ScriptsNavigator.js</file>
     
    145146    <file>SidebarPane.js</file>
    146147    <file>SidebarTreeElement.js</file>
    147     <file>SnippetsModel.js</file>
     148    <file>SnippetStorage.js</file>
    148149    <file>SoftContextMenu.js</file>
    149150    <file>SourceCSSTokenizer.js</file>
  • trunk/Source/WebCore/inspector/front-end/inspector.html

    r116854 r117065  
    212212    <script type="text/javascript" src="HandlerRegistry.js"></script>
    213213    <script type="text/javascript" src="MemoryStatistics.js"></script>
    214     <script type="text/javascript" src="SnippetsModel.js"></script>
     214    <script type="text/javascript" src="SnippetStorage.js"></script>
     215    <script type="text/javascript" src="ScriptSnippetModel.js"></script>
    215216    <script type="text/javascript" src="StylesPanel.js"></script>
    216217</head>
  • trunk/Source/WebCore/inspector/front-end/inspector.js

    r116957 r117065  
    381381
    382382    this.debuggerModel = new WebInspector.DebuggerModel();
    383     this.snippetsModel = new WebInspector.SnippetsModel();
     383    this.scriptSnippetModel = new WebInspector.ScriptSnippetModel();
    384384    this.breakpointManager = new WebInspector.BreakpointManager(WebInspector.settings.breakpoints, this.debuggerModel);
    385385    this.debuggerPresentationModel = new WebInspector.DebuggerPresentationModel();
Note: See TracChangeset for help on using the changeset viewer.