Changeset 109561 in webkit


Ignore:
Timestamp:
Mar 2, 2012 5:22:12 AM (12 years ago)
Author:
podivilov@chromium.org
Message:

Web Inspector: limit RawSourceCode usages to DebuggerPresentationModel.
https://bugs.webkit.org/show_bug.cgi?id=80146

Reviewed by Vsevolod Vlasov.

  • inspector/front-end/DebuggerPresentationModel.js:

(WebInspector.DebuggerPresentationModel.prototype.uiLocationToRawLocation):
(WebInspector.DebuggerPresentationModel.Linkifier.prototype.linkifyLocation):
(WebInspector.DebuggerPresentationModel.Linkifier.prototype.linkifyRawLocation):

  • inspector/front-end/ObjectPopoverHelper.js:

(WebInspector.ObjectPopoverHelper.prototype._showObjectPopover.showObjectPopover.):
(WebInspector.ObjectPopoverHelper.prototype._showObjectPopover):

  • inspector/front-end/ScriptsSearchScope.js:

(WebInspector.ScriptsSearchResultsPane.prototype.createAnchor):

Location:
trunk/Source/WebCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r109560 r109561  
     12012-03-02  Pavel Podivilov  <podivilov@chromium.org>
     2
     3        Web Inspector: limit RawSourceCode usages to DebuggerPresentationModel.
     4        https://bugs.webkit.org/show_bug.cgi?id=80146
     5
     6        Reviewed by Vsevolod Vlasov.
     7
     8        * inspector/front-end/DebuggerPresentationModel.js:
     9        (WebInspector.DebuggerPresentationModel.prototype.uiLocationToRawLocation):
     10        (WebInspector.DebuggerPresentationModel.Linkifier.prototype.linkifyLocation):
     11        (WebInspector.DebuggerPresentationModel.Linkifier.prototype.linkifyRawLocation):
     12        * inspector/front-end/ObjectPopoverHelper.js:
     13        (WebInspector.ObjectPopoverHelper.prototype._showObjectPopover.showObjectPopover.):
     14        (WebInspector.ObjectPopoverHelper.prototype._showObjectPopover):
     15        * inspector/front-end/ScriptsSearchScope.js:
     16        (WebInspector.ScriptsSearchResultsPane.prototype.createAnchor):
     17
    1182012-03-02  Pavel Podivilov  <podivilov@chromium.org>
    219
  • trunk/Source/WebCore/inspector/front-end/DebuggerPresentationModel.js

    r109560 r109561  
    106106
    107107    /**
     108     * @param {WebInspector.UISourceCode} uiSourceCode
     109     * @param {number} lineNumber
     110     * @param {number} columnNumber
     111     * @return {DebuggerAgent.Location}
     112     */
     113    uiLocationToRawLocation: function(uiSourceCode, lineNumber, columnNumber)
     114    {
     115        return uiSourceCode.rawSourceCode.uiLocationToRawLocation(uiSourceCode, lineNumber, columnNumber);
     116    },
     117
     118    /**
    108119     * @param {WebInspector.Event} event
    109120     */
     
    977988    linkifyLocation: function(sourceURL, lineNumber, columnNumber, classes)
    978989    {
    979         var rawSourceCode = this._model._rawSourceCodeForScriptWithURL(sourceURL);
    980         if (!rawSourceCode)
     990        var script = this._model._scriptForURLAndLocation(sourceURL, lineNumber, columnNumber);
     991        if (!script)
    981992            return WebInspector.linkifyResourceAsNode(sourceURL, lineNumber, classes);
    982 
    983         return this.linkifyRawSourceCode(rawSourceCode, lineNumber, columnNumber, classes);
    984     },
    985 
    986     /**
    987      * @param {WebInspector.RawSourceCode} rawSourceCode
    988      * @param {number=} lineNumber
    989      * @param {number=} columnNumber
     993        var rawLocation = new WebInspector.DebuggerModel.Location(lineNumber, columnNumber);
     994        rawLocation.scriptId = script.scriptId;
     995        return this.linkifyRawLocation(rawLocation, classes);
     996    },
     997
     998    /**
     999     * @param {WebInspector.DebuggerModel.Location} rawLocation
    9901000     * @param {string=} classes
    9911001     */
    992     linkifyRawSourceCode: function(rawSourceCode, lineNumber, columnNumber, classes)
    993     {
    994         var anchor = WebInspector.linkifyURLAsNode(rawSourceCode.url, "", classes, false);
    995         var rawLocation = { lineNumber: lineNumber, columnNumber: columnNumber };
     1002    linkifyRawLocation: function(rawLocation, classes)
     1003    {
     1004        var anchor = WebInspector.linkifyURLAsNode("", "", classes, false);
     1005        var script = WebInspector.debuggerModel.scriptForSourceID(rawLocation.scriptId);
     1006        var rawSourceCode = this._model._rawSourceCodeForScript(script);
    9961007        var liveLocation = rawSourceCode.createLiveLocation(rawLocation, this._updateAnchor.bind(this, anchor));
    9971008        liveLocation.init();
    9981009        this._liveLocations.push(liveLocation);
    9991010        return anchor;
    1000     },
    1001 
    1002     linkifyFunctionLocation: function(functionLocation, classes)
    1003     {
    1004         var rawSourceCode = this._model._rawSourceCodeForScriptId[functionLocation.scriptId];
    1005         if (!rawSourceCode)
    1006             return undefined;
    1007         return this.linkifyRawSourceCode(rawSourceCode, functionLocation.lineNumber, functionLocation.columnNumber, classes);
    10081011    },
    10091012
  • trunk/Source/WebCore/inspector/front-end/ObjectPopoverHelper.js

    r107089 r109561  
    7474
    7575                        this._linkifier = WebInspector.debuggerPresentationModel.createLinkifier();
    76                         var link = this._linkifier.linkifyFunctionLocation(response.location, "function-location-link");
     76                        var link = this._linkifier.linkifyRawLocation(response.location, "function-location-link");
    7777                        if (link)
    7878                            title.appendChild(link);
  • trunk/Source/WebCore/inspector/front-end/ScriptsSearchScope.js

    r109328 r109561  
    145145    createAnchor: function(file, lineNumber, columnNumber)
    146146    {
    147        
    148147        var uiSourceCode = file;
    149         var rawSourceCode = uiSourceCode.rawSourceCode;
    150         var rawLocation = rawSourceCode.uiLocationToRawLocation(uiSourceCode, lineNumber, columnNumber);
    151         var anchor = this._linkifier.linkifyRawSourceCode(uiSourceCode.rawSourceCode, rawLocation.lineNumber, rawLocation.columnNumber);
     148        var rawLocation = WebInspector.debuggerPresentationModel.uiLocationToRawLocation(uiSourceCode, lineNumber, columnNumber);
     149        var anchor = this._linkifier.linkifyRawLocation(rawLocation);
    152150        anchor.removeChildren();
    153151        return anchor;
Note: See TracChangeset for help on using the changeset viewer.