Changeset 96694 in webkit


Ignore:
Timestamp:
Oct 5, 2011 4:41:07 AM (13 years ago)
Author:
loislo@chromium.org
Message:

Web Inspector: debuggerPresentatioModel.linkifyLocation leaks updateAnchor closure instances.
https://bugs.webkit.org/show_bug.cgi?id=69146

In many places we use linkifyLocation function to produce a link node which updates automatically when the source file is changed on the fly.
Such changes happen when we use pretty print or another operation that changes the source code somehow.
linkifyLocation associates a new instance of updateAnchor closure with the each link node and add the closure to the SourceMappingUpdated event's list.
As the result the node<->closure pairs wouldn't be collected until reset the UI and DebuggerPresentationModel.

Reviewed by Pavel Feldman.

Source/WebCore:

Test: inspector/debugger/linkifier.html

  • inspector/front-end/ConsoleMessage.js:

(WebInspector.ConsoleMessageImpl):
(WebInspector.ConsoleMessageImpl.prototype._linkifyLocation):

  • inspector/front-end/ConsoleView.js:

(WebInspector.ConsoleView.prototype._consoleCleared):
(WebInspector.ConsoleCommandResult):
(WebInspector.ConsoleMessage.create):
(WebInspector.ConsoleMessage.createTextMessage):

  • inspector/front-end/DebuggerPresentationModel.js:

(WebInspector.DebuggerPresentationModel.prototype.createLinkifier):
(WebInspector.DebuggerPresentationModel.Linkifier):
(WebInspector.DebuggerPresentationModel.Linkifier.prototype.linkifyLocation):
(WebInspector.DebuggerPresentationModel.Linkifier.prototype.reset):
(WebInspector.DebuggerPresentationModel.Linkifier.prototype._updateSourceAnchors):
(WebInspector.DebuggerPresentationModel.Linkifier.prototype._updateAnchor):

  • inspector/front-end/EventListenersSidebarPane.js:

(WebInspector.EventListenersSidebarPane.prototype.update.callback):
(WebInspector.EventListenersSidebarPane.prototype.update):
():

  • inspector/front-end/NetworkPanel.js:

(WebInspector.NetworkLogView):
(WebInspector.NetworkLogView.prototype._reset):
(WebInspector.NetworkDataGridNode.prototype._refreshInitiatorCell):

  • inspector/front-end/ProfileDataGridTree.js:

(WebInspector.ProfileDataGridNode.prototype.createCell):

  • inspector/front-end/ProfileView.js:

(WebInspector.CPUProfileView):
(WebInspector.CPUProfileView.prototype._resetClicked):

  • inspector/front-end/TimelinePanel.js:

(WebInspector.TimelinePanel):
(WebInspector.TimelinePanel.prototype._linkifyLocation):
(WebInspector.TimelinePanel.prototype._linkifyCallFrame):
(WebInspector.TimelinePanel.prototype._clearPanel):
(WebInspector.TimelinePanel.FormattedRecord):
(WebInspector.TimelinePanel.FormattedRecord.prototype._generatePopupContent):
(WebInspector.TimelinePanel.FormattedRecord.prototype._getRecordDetails):
(WebInspector.TimelinePanel.PopupContentHelper):
(WebInspector.TimelinePanel.PopupContentHelper.prototype._appendLinkRow):
(WebInspector.TimelinePanel.PopupContentHelper.prototype._appendStackTrace):

  • inspector/front-end/inspector.js:

LayoutTests:

  • inspector/debugger/linkifier-expected.txt: Added.
  • inspector/debugger/linkifier.html: Added.
Location:
trunk
Files:
2 added
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r96687 r96694  
     12011-10-04  Ilya Tikhonovsky  <loislo@chromium.org>
     2
     3        Web Inspector: debuggerPresentatioModel.linkifyLocation leaks updateAnchor closure instances.
     4        https://bugs.webkit.org/show_bug.cgi?id=69146
     5
     6        In many places we use linkifyLocation function to produce a link node which updates automatically when the source file is changed on the fly.
     7        Such changes happen when we use pretty print or another operation that changes the source code somehow.
     8        linkifyLocation associates a new instance of updateAnchor closure with the each link node and add the closure to the SourceMappingUpdated event's list.
     9        As the result the node<->closure pairs wouldn't be collected until reset the UI and DebuggerPresentationModel.
     10
     11        Reviewed by Pavel Feldman.
     12
     13        * inspector/debugger/linkifier-expected.txt: Added.
     14        * inspector/debugger/linkifier.html: Added.
     15
    1162011-10-05  Hans Wennborg  <hans@chromium.org>
    217
  • trunk/Source/WebCore/ChangeLog

    r96693 r96694  
     12011-10-04  Ilya Tikhonovsky  <loislo@chromium.org>
     2
     3        Web Inspector: debuggerPresentatioModel.linkifyLocation leaks updateAnchor closure instances.
     4        https://bugs.webkit.org/show_bug.cgi?id=69146
     5
     6        In many places we use linkifyLocation function to produce a link node which updates automatically when the source file is changed on the fly.
     7        Such changes happen when we use pretty print or another operation that changes the source code somehow.
     8        linkifyLocation associates a new instance of updateAnchor closure with the each link node and add the closure to the SourceMappingUpdated event's list.
     9        As the result the node<->closure pairs wouldn't be collected until reset the UI and DebuggerPresentationModel.
     10
     11        Reviewed by Pavel Feldman.
     12
     13        Test: inspector/debugger/linkifier.html
     14
     15        * inspector/front-end/ConsoleMessage.js:
     16        (WebInspector.ConsoleMessageImpl):
     17        (WebInspector.ConsoleMessageImpl.prototype._linkifyLocation):
     18        * inspector/front-end/ConsoleView.js:
     19        (WebInspector.ConsoleView.prototype._consoleCleared):
     20        (WebInspector.ConsoleCommandResult):
     21        (WebInspector.ConsoleMessage.create):
     22        (WebInspector.ConsoleMessage.createTextMessage):
     23        * inspector/front-end/DebuggerPresentationModel.js:
     24        (WebInspector.DebuggerPresentationModel.prototype.createLinkifier):
     25        (WebInspector.DebuggerPresentationModel.Linkifier):
     26        (WebInspector.DebuggerPresentationModel.Linkifier.prototype.linkifyLocation):
     27        (WebInspector.DebuggerPresentationModel.Linkifier.prototype.reset):
     28        (WebInspector.DebuggerPresentationModel.Linkifier.prototype._updateSourceAnchors):
     29        (WebInspector.DebuggerPresentationModel.Linkifier.prototype._updateAnchor):
     30        * inspector/front-end/EventListenersSidebarPane.js:
     31        (WebInspector.EventListenersSidebarPane.prototype.update.callback):
     32        (WebInspector.EventListenersSidebarPane.prototype.update):
     33        ():
     34        * inspector/front-end/NetworkPanel.js:
     35        (WebInspector.NetworkLogView):
     36        (WebInspector.NetworkLogView.prototype._reset):
     37        (WebInspector.NetworkDataGridNode.prototype._refreshInitiatorCell):
     38        * inspector/front-end/ProfileDataGridTree.js:
     39        (WebInspector.ProfileDataGridNode.prototype.createCell):
     40        * inspector/front-end/ProfileView.js:
     41        (WebInspector.CPUProfileView):
     42        (WebInspector.CPUProfileView.prototype._resetClicked):
     43        * inspector/front-end/TimelinePanel.js:
     44        (WebInspector.TimelinePanel):
     45        (WebInspector.TimelinePanel.prototype._linkifyLocation):
     46        (WebInspector.TimelinePanel.prototype._linkifyCallFrame):
     47        (WebInspector.TimelinePanel.prototype._clearPanel):
     48        (WebInspector.TimelinePanel.FormattedRecord):
     49        (WebInspector.TimelinePanel.FormattedRecord.prototype._generatePopupContent):
     50        (WebInspector.TimelinePanel.FormattedRecord.prototype._getRecordDetails):
     51        (WebInspector.TimelinePanel.PopupContentHelper):
     52        (WebInspector.TimelinePanel.PopupContentHelper.prototype._appendLinkRow):
     53        (WebInspector.TimelinePanel.PopupContentHelper.prototype._appendStackTrace):
     54        * inspector/front-end/inspector.js:
     55
    1562011-10-03  Andreas Kling  <kling@webkit.org>
    257
  • trunk/Source/WebCore/inspector/front-end/ConsoleMessage.js

    r96519 r96694  
    2929 */
    3030
    31 WebInspector.ConsoleMessage.create = function(source, type, level, line, url, repeatCount, message, parameters, stackTrace, request)
    32 {
    33     return new WebInspector.ConsoleMessageImpl(source, type, level, line, url, repeatCount, message, parameters, stackTrace, request);
    34 }
    35 
    36 WebInspector.ConsoleMessage.createTextMessage = function(text, level)
    37 {
    38     level = level || WebInspector.ConsoleMessage.MessageLevel.Log;
    39     return new WebInspector.ConsoleMessageImpl(WebInspector.ConsoleMessage.MessageSource.ConsoleAPI, WebInspector.ConsoleMessage.MessageType.Log, level, 0, null, 1, null, [text], null);
    40 }
    41 
    4231/**
    4332 * @constructor
    4433 * @extends {WebInspector.ConsoleMessage}
     34 * @param {WebInspector.DebuggerPresentationModel.Linkifier} linkifier
    4535 * @param {Array.<RuntimeAgent.RemoteObject>=} parameters
    4636 * @param {ConsoleAgent.StackTrace=} stackTrace
    4737 * @param {WebInspector.Resource=} request
    4838 */
    49 WebInspector.ConsoleMessageImpl = function(source, type, level, line, url, repeatCount, message, parameters, stackTrace, request)
     39WebInspector.ConsoleMessageImpl = function(source, type, level, line, url, repeatCount, message, linkifier, parameters, stackTrace, request)
    5040{
    5141    WebInspector.ConsoleMessage.call();
    5242
     43    this._linkifier = linkifier;
    5344    this.source = source;
    5445    this.type = type;
     
    195186        lineNumber = lineNumber ? lineNumber - 1 : undefined;
    196187        columnNumber = columnNumber ? columnNumber - 1 : 0;
    197         return WebInspector.debuggerPresentationModel.linkifyLocation(url, lineNumber, columnNumber, "console-message-url");
     188        return this._linkifier.linkifyLocation(url, lineNumber, columnNumber, "console-message-url");
    198189    },
    199190
  • trunk/Source/WebCore/inspector/front-end/ConsoleView.js

    r96575 r96694  
    111111    WebInspector.console.addEventListener(WebInspector.ConsoleModel.Events.MessageAdded, this._consoleMessageAdded, this);
    112112    WebInspector.console.addEventListener(WebInspector.ConsoleModel.Events.ConsoleCleared, this._consoleCleared, this);
     113
     114    this._linkifier = WebInspector.debuggerPresentationModel.createLinkifier();
    113115}
    114116
     
    327329
    328330        this.dispatchEventToListeners(WebInspector.ConsoleView.Events.ConsoleCleared);
     331
     332        this._linkifier.reset();
    329333    },
    330334
     
    618622            WebInspector.settings.consoleHistory.set(this.prompt.history.slice(-30));
    619623
    620             this._appendConsoleMessage(new WebInspector.ConsoleCommandResult(result, wasThrown, commandMessage));
     624            this._appendConsoleMessage(new WebInspector.ConsoleCommandResult(result, wasThrown, commandMessage, this._linkifier));
    621625        }
    622626        this.evalInInspectedWindow(str, "console", true, undefined, undefined, printResult.bind(this));
     
    695699 * @constructor
    696700 */
    697 WebInspector.ConsoleCommandResult = function(result, wasThrown, originatingCommand)
     701WebInspector.ConsoleCommandResult = function(result, wasThrown, originatingCommand, linkifier)
    698702{
    699703    var level = (wasThrown ? WebInspector.ConsoleMessage.MessageLevel.Error : WebInspector.ConsoleMessage.MessageLevel.Log);
    700704    this.originatingCommand = originatingCommand;
    701     WebInspector.ConsoleMessageImpl.call(this, WebInspector.ConsoleMessage.MessageSource.JS, WebInspector.ConsoleMessage.MessageType.Result, level, -1, null, 1, null, [result]);
     705    WebInspector.ConsoleMessageImpl.call(this, WebInspector.ConsoleMessage.MessageSource.JS, WebInspector.ConsoleMessage.MessageType.Result, level, -1, null, 1, null, linkifier, [result]);
    702706}
    703707
     
    777781 */
    778782WebInspector.consoleView = null;
     783
     784WebInspector.ConsoleMessage.create = function(source, type, level, line, url, repeatCount, message, parameters, stackTrace, request)
     785{
     786    return new WebInspector.ConsoleMessageImpl(source, type, level, line, url, repeatCount, message, WebInspector.consoleView._linkifier, parameters, stackTrace, request);
     787}
     788
     789WebInspector.ConsoleMessage.createTextMessage = function(text, level)
     790{
     791    level = level || WebInspector.ConsoleMessage.MessageLevel.Log;
     792    return new WebInspector.ConsoleMessageImpl(WebInspector.ConsoleMessage.MessageSource.ConsoleAPI, WebInspector.ConsoleMessage.MessageType.Log, level, 0, null, 1, null, WebInspector.consoleView._linkifier, [text], null);
     793}
  • trunk/Source/WebCore/inspector/front-end/DebuggerPresentationModel.js

    r96588 r96694  
    6868
    6969WebInspector.DebuggerPresentationModel.prototype = {
    70     linkifyLocation: function(sourceURL, lineNumber, columnNumber, classes)
    71     {
    72         var linkText = WebInspector.formatLinkText(sourceURL, lineNumber);
    73         var anchor = WebInspector.linkifyURLAsNode(sourceURL, linkText, classes, false);
    74 
    75         var rawSourceCode = this._rawSourceCodeForScriptWithURL(sourceURL);
    76         if (!rawSourceCode) {
    77             anchor.setAttribute("preferred_panel", "resources");
    78             anchor.setAttribute("line_number", lineNumber);
    79             return anchor;
    80         }
    81 
    82         function updateAnchor()
    83         {
    84             var uiLocation = rawSourceCode.sourceMapping.rawLocationToUILocation({ lineNumber: lineNumber, columnNumber: columnNumber });
    85             anchor.textContent = WebInspector.formatLinkText(uiLocation.uiSourceCode.url, uiLocation.lineNumber);
    86             anchor.setAttribute("preferred_panel", "scripts");
    87             anchor.uiSourceCode = uiLocation.uiSourceCode;
    88             anchor.lineNumber = uiLocation.lineNumber;
    89         }
    90         if (rawSourceCode.sourceMapping)
    91             updateAnchor.call(this);
    92         rawSourceCode.addEventListener(WebInspector.RawSourceCode.Events.SourceMappingUpdated, updateAnchor, this);
    93         return anchor;
     70    createLinkifier: function()
     71    {
     72        return new WebInspector.DebuggerPresentationModel.Linkifier(this);
    9473    },
    9574
     
    578557}
    579558
     559/**
     560 * @constructor
     561 */
     562WebInspector.DebuggerPresentationModel.Linkifier = function(model)
     563{
     564    this._model = model;
     565    this._anchorsForRawSourceCode = {};
     566}
     567
     568WebInspector.DebuggerPresentationModel.Linkifier.prototype = {
     569    linkifyLocation: function(sourceURL, lineNumber, columnNumber, classes)
     570    {
     571        var linkText = WebInspector.formatLinkText(sourceURL, lineNumber);
     572        var anchor = WebInspector.linkifyURLAsNode(sourceURL, linkText, classes, false);
     573        anchor.rawLocation = { lineNumber: lineNumber, columnNumber: columnNumber };
     574
     575        var rawSourceCode = this._model._rawSourceCodeForScriptWithURL(sourceURL);
     576        if (!rawSourceCode) {
     577            anchor.setAttribute("preferred_panel", "resources");
     578            anchor.setAttribute("line_number", lineNumber);
     579            return anchor;
     580        }
     581
     582        var anchors = this._anchorsForRawSourceCode[rawSourceCode.id];
     583        if (!anchors) {
     584            anchors = [];
     585            this._anchorsForRawSourceCode[rawSourceCode.id] = anchors;
     586            rawSourceCode.addEventListener(WebInspector.RawSourceCode.Events.SourceMappingUpdated, this._updateSourceAnchors, this);
     587        }
     588
     589        if (rawSourceCode.sourceMapping)
     590            this._updateAnchor(rawSourceCode, anchor);
     591        anchors.push(anchor);
     592        return anchor;
     593    },
     594
     595    reset: function()
     596    {
     597        for (var id in this._anchorsForRawSourceCode)
     598            this._model._rawSourceCode[id].removeEventListener(WebInspector.RawSourceCode.Events.SourceMappingUpdated, this._updateSourceAnchors, this);
     599        this._anchorsForRawSourceCode = {};
     600    },
     601
     602    _updateSourceAnchors: function(event)
     603    {
     604        var rawSourceCode = event.target;
     605        var anchors = this._anchorsForRawSourceCode[rawSourceCode.id];
     606        for (var i = 0; i < anchors.length; ++i)
     607            this._updateAnchor(rawSourceCode, anchors[i]);
     608    },
     609
     610    _updateAnchor: function(rawSourceCode, anchor)
     611    {
     612        var uiLocation = rawSourceCode.sourceMapping.rawLocationToUILocation(anchor.rawLocation);
     613        anchor.textContent = WebInspector.formatLinkText(uiLocation.uiSourceCode.url, uiLocation.lineNumber);
     614        anchor.setAttribute("preferred_panel", "scripts");
     615        anchor.uiSourceCode = uiLocation.uiSourceCode;
     616        anchor.lineNumber = uiLocation.lineNumber;
     617    }
     618}
     619
    580620WebInspector.DebuggerPresentationModelResourceBinding.prototype.__proto__ = WebInspector.ResourceDomainModelBinding.prototype;
    581621
  • trunk/Source/WebCore/inspector/front-end/EventListenersSidebarPane.js

    r96519 r96694  
    5757
    5858    this.titleElement.appendChild(this.settingsSelectElement);
     59
     60    this._linkifier = WebInspector.debuggerPresentationModel.createLinkifier();
    5961}
    6062
     
    6567    {
    6668        RuntimeAgent.releaseObjectGroup(WebInspector.EventListenersSidebarPane._objectGroupName);
     69        this._linkifier.reset();
     70
    6771        var body = this.bodyElement;
    6872        body.removeChildren();
     
    8589                var section = sectionMap[type];
    8690                if (!section) {
    87                     section = new WebInspector.EventListenersSection(type, node.id);
     91                    section = new WebInspector.EventListenersSection(type, node.id, self._linkifier);
    8892                    sectionMap[type] = section;
    8993                    sectionNames.push(type);
     
    125129WebInspector.EventListenersSidebarPane.prototype.__proto__ = WebInspector.SidebarPane.prototype;
    126130
    127 WebInspector.EventListenersSection = function(title, nodeId)
     131WebInspector.EventListenersSection = function(title, nodeId, linkifier)
    128132{
    129133    this.eventListeners = [];
    130134    this._nodeId = nodeId;
     135    this._linkifier = linkifier;
    131136    WebInspector.PropertiesSection.call(this, title);
    132137
     
    159164        for (var i = 0; i < length; ++i) {
    160165            var eventListener = filteredEventListeners[i];
    161             var eventListenerBar = new WebInspector.EventListenerBar(eventListener, this._nodeId);
     166            var eventListenerBar = new WebInspector.EventListenerBar(eventListener, this._nodeId, this._linkifier);
    162167            this.eventBars.appendChild(eventListenerBar.element);
    163168        }
     
    172177WebInspector.EventListenersSection.prototype.__proto__ = WebInspector.PropertiesSection.prototype;
    173178
    174 WebInspector.EventListenerBar = function(eventListener, nodeId)
     179WebInspector.EventListenerBar = function(eventListener, nodeId, linkifier)
    175180{
    176181    this.eventListener = eventListener;
     
    178183    WebInspector.ObjectPropertiesSection.call(this);
    179184    this._setNodeTitle();
    180     this._setFunctionSubtitle();
     185    this._setFunctionSubtitle(linkifier);
    181186    this.editable = false;
    182187    this.element.className = "event-bar"; /* Changed from "section" */
     
    232237    },
    233238
    234     _setFunctionSubtitle: function()
     239    _setFunctionSubtitle: function(linkifier)
    235240    {
    236241        // Requires that Function.toString() return at least the function's signature.
     
    241246            var lineNumber = this.eventListener.location.lineNumber - 1;
    242247            var columnNumber = 0;
    243             var urlElement = WebInspector.debuggerPresentationModel.linkifyLocation(url, lineNumber, columnNumber);
     248            var urlElement = linkifier.linkifyLocation(url, lineNumber, columnNumber);
    244249            this.subtitleElement.appendChild(urlElement);
    245250        } else {
  • trunk/Source/WebCore/inspector/front-end/NetworkPanel.js

    r96577 r96694  
    5757    this._createStatusbarButtons();
    5858    this._createFilterStatusBarItems();
     59    this._linkifier = WebInspector.debuggerPresentationModel.createLinkifier();
    5960
    6061    WebInspector.networkManager.addEventListener(WebInspector.NetworkManager.EventTypes.ResourceStarted, this._onResourceStarted, this);
     
    736737        this._mainResourceLoadTime = -1;
    737738        this._mainResourceDOMContentTime = -1;
    738 
     739        this._linkifier.reset();
    739740    },
    740741
     
    20462047                }
    20472048                this._initiatorCell.title = topFrame.url + ":" + topFrame.lineNumber;
    2048                 var urlElement = WebInspector.debuggerPresentationModel.linkifyLocation(topFrame.url, topFrame.lineNumber - 1, 0);
     2049                var urlElement = this._parentView._linkifier.linkifyLocation(topFrame.url, topFrame.lineNumber - 1, 0);
    20492050                this._initiatorCell.appendChild(urlElement);
    20502051                this._appendSubtitle(this._initiatorCell, WebInspector.UIString("Script"));
  • trunk/Source/WebCore/inspector/front-end/ProfileDataGridTree.js

    r96519 r96694  
    9999            // FIXME(62725): profileNode should reference a debugger location.
    100100            var lineNumber = this.profileNode.lineNumber ? this.profileNode.lineNumber - 1 : 0;
    101             var urlElement = WebInspector.debuggerPresentationModel.linkifyLocation(this.profileNode.url, lineNumber, 0, "profile-node-file");
     101            var urlElement = this.profileView._linkifier.linkifyLocation(this.profileNode.url, lineNumber, 0, "profile-node-file");
    102102            urlElement.style.maxWidth = "75%";
    103103            cell.insertBefore(urlElement, cell.firstChild);
  • trunk/Source/WebCore/inspector/front-end/ProfileView.js

    r96519 r96694  
    9797    }
    9898
     99    this._linkifier = WebInspector.debuggerPresentationModel.createLinkifier();
     100
    99101    ProfilerAgent.getProfile(this.profile.typeId, this.profile.uid, profileCallback);
    100102}
     
    486488        this.resetButton.visible = false;
    487489        this.profileDataGridTree.restore();
     490        this._linkifier.reset();
    488491        this.refresh();
    489492        this.refreshVisibleData();
  • trunk/Source/WebCore/inspector/front-end/TimelinePanel.js

    r96596 r96694  
    110110    this._registerShortcuts();
    111111    WebInspector.timelineManager.addEventListener(WebInspector.TimelineManager.EventTypes.TimelineEventRecorded, this._onTimelineEventRecorded, this);
     112    this._linkifier = WebInspector.debuggerPresentationModel.createLinkifier();
    112113}
    113114
     
    117118
    118119WebInspector.TimelinePanel.prototype = {
     120    _linkifyLocation: function(url, lineNumber, columnNumber)
     121    {
     122        // FIXME(62725): stack trace line/column numbers are one-based.
     123        lineNumber = lineNumber ? lineNumber - 1 : lineNumber;
     124        columnNumber = columnNumber ? columnNumber - 1 : 0;
     125        return this._linkifier.linkifyLocation(url, lineNumber, columnNumber, "timeline-details");
     126    },
     127
     128    _linkifyCallFrame: function(callFrame)
     129    {
     130        return this._linkifyLocation(callFrame.url, callFrame.lineNumber, callFrame.columnNumber);
     131    },
     132
    119133    _createTopPane: function() {
    120134        var topPaneElement = document.createElement("div");
     
    529543        this._closeRecordDetails();
    530544        this._model._reset();
     545        this._linkifier.reset();
    531546    },
    532547
     
    962977WebInspector.TimelinePanel.FormattedRecord = function(record, parentRecord, panel, scriptDetails)
    963978{
     979    this._panel = panel;
    964980    var recordTypes = WebInspector.TimelineAgent.RecordType;
    965981    var style = panel._recordStyles[record.type];
     
    10521068    _generatePopupContent: function(calculator, categories)
    10531069    {
    1054         var contentHelper = new WebInspector.TimelinePanel.PopupContentHelper(this.title);
     1070        var contentHelper = new WebInspector.TimelinePanel.PopupContentHelper(this.title, this._panel);
    10551071
    10561072        if (this._children && this._children.length) {
     
    11371153                return WebInspector.UIString("%s collected", Number.bytesToString(this.data.usedHeapSizeDelta));
    11381154            case WebInspector.TimelineAgent.RecordType.TimerFire:
    1139                 return this.scriptName ? this._linkifyLocation(this.scriptName, this.scriptLine, 0) : this.data.timerId;
     1155                return this.scriptName ? this._panel._linkifyLocation(this.scriptName, this.scriptLine, 0) : this.data.timerId;
    11401156            case WebInspector.TimelineAgent.RecordType.FunctionCall:
    1141                 return this.scriptName ? this._linkifyLocation(this.scriptName, this.scriptLine, 0) : null;
     1157                return this.scriptName ? this._panel._linkifyLocation(this.scriptName, this.scriptLine, 0) : null;
    11421158            case WebInspector.TimelineAgent.RecordType.FireAnimationFrameEvent:
    1143                 return this.scriptName ? this._linkifyLocation(this.scriptName, this.scriptLine, 0) : this.data.id;
     1159                return this.scriptName ? this._panel._linkifyLocation(this.scriptName, this.scriptLine, 0) : this.data.id;
    11441160            case WebInspector.TimelineAgent.RecordType.EventDispatch:
    11451161                return this.data ? this.data.type : null;
     
    11481164            case WebInspector.TimelineAgent.RecordType.TimerInstall:
    11491165            case WebInspector.TimelineAgent.RecordType.TimerRemove:
    1150                 return this.stackTrace ? this._linkifyCallFrame(this.stackTrace[0]) : this.data.timerId;
     1166                return this.stackTrace ? this._panel._linkifyCallFrame(this.stackTrace[0]) : this.data.timerId;
    11511167            case WebInspector.TimelineAgent.RecordType.RegisterAnimationFrameCallback:
    11521168            case WebInspector.TimelineAgent.RecordType.CancelAnimationFrameCallback:
    1153                 return this.stackTrace ? this._linkifyCallFrame(this.stackTrace[0]) : this.data.id;
     1169                return this.stackTrace ? this._panel._linkifyCallFrame(this.stackTrace[0]) : this.data.id;
    11541170            case WebInspector.TimelineAgent.RecordType.ParseHTML:
    11551171            case WebInspector.TimelineAgent.RecordType.RecalculateStyles:
    1156                 return this.stackTrace ? this._linkifyCallFrame(this.stackTrace[0]) : null;
     1172                return this.stackTrace ? this._panel._linkifyCallFrame(this.stackTrace[0]) : null;
    11571173            case WebInspector.TimelineAgent.RecordType.EvaluateScript:
    1158                 return this.url ? this._linkifyLocation(this.url, this.data.lineNumber, 0) : null;
     1174                return this.url ? this._panel._linkifyLocation(this.url, this.data.lineNumber, 0) : null;
    11591175            case WebInspector.TimelineAgent.RecordType.XHRReadyStateChange:
    11601176            case WebInspector.TimelineAgent.RecordType.XHRLoad:
     
    11721188    },
    11731189
    1174     _linkifyLocation: function(url, lineNumber, columnNumber)
    1175     {
    1176         // FIXME(62725): stack trace line/column numbers are one-based.
    1177         lineNumber = lineNumber ? lineNumber - 1 : lineNumber;
    1178         columnNumber = columnNumber ? columnNumber - 1 : 0;
    1179         return WebInspector.debuggerPresentationModel.linkifyLocation(url, lineNumber, columnNumber, "timeline-details");
    1180     },
    1181 
    1182     _linkifyCallFrame: function(callFrame)
    1183     {
    1184         return this._linkifyLocation(callFrame.url, callFrame.lineNumber, callFrame.columnNumber);
    1185     },
    1186 
    11871190    _calculateAggregatedStats: function(categories)
    11881191    {
     
    12051208}
    12061209
    1207 WebInspector.TimelinePanel.PopupContentHelper = function(title)
     1210WebInspector.TimelinePanel.PopupContentHelper = function(title, panel)
    12081211{
     1212    this._panel = panel;
    12091213    this._contentTable = document.createElement("table");;
    12101214    var titleCell = this._createCell(WebInspector.UIString("%s - Details", title), "timeline-details-title");
     
    12521256    _appendLinkRow: function(title, scriptName, scriptLine)
    12531257    {
    1254         var link = WebInspector.TimelinePanel.FormattedRecord.prototype._linkifyLocation(scriptName, scriptLine, 0, "timeline-details");
     1258        var link = this._panel._linkifyLocation(scriptName, scriptLine, 0, "timeline-details");
    12551259        this._appendElementRow(title, link);
    12561260    },
     
    12671271            row.appendChild(this._createCell(" @ "));
    12681272            var linkCell = document.createElement("td");
    1269             var urlElement = WebInspector.TimelinePanel.FormattedRecord.prototype._linkifyCallFrame(stackFrame);
     1273            var urlElement = this._panel._linkifyCallFrame(stackFrame);
    12701274            linkCell.appendChild(urlElement);
    12711275            row.appendChild(linkCell);
  • trunk/Source/WebCore/inspector/front-end/inspector.js

    r96604 r96694  
    510510    this.console.addEventListener(WebInspector.ConsoleModel.Events.RepeatCountUpdated, this._updateErrorAndWarningCounts, this);
    511511
     512    this.debuggerModel = new WebInspector.DebuggerModel();
     513    this.debuggerPresentationModel = new WebInspector.DebuggerPresentationModel();
     514
    512515    this.drawer = new WebInspector.Drawer();
    513516    this.consoleView = new WebInspector.ConsoleView(WebInspector.WorkerManager.isWorkerFrontend());
     
    522525
    523526    this.cssModel = new WebInspector.CSSStyleModel();
    524     this.debuggerModel = new WebInspector.DebuggerModel();
    525     this.debuggerPresentationModel = new WebInspector.DebuggerPresentationModel();
    526527
    527528    this.searchController = new WebInspector.SearchController();
Note: See TracChangeset for help on using the changeset viewer.