Changeset 63757 in webkit


Ignore:
Timestamp:
Jul 20, 2010 10:53:44 AM (14 years ago)
Author:
loislo@chromium.org
Message:

2010-07-20 Ilya Tikhonovsky <loislo@chromium.org>

Reviewed by Pavel Feldman.

WebInspector: It is possible to show full call stack instead of top frame for Caller
and Call Site properties in Timeline panel.
https://bugs.webkit.org/show_bug.cgi?id=42620

  • English.lproj/localizedStrings.js:
  • inspector/front-end/TimelinePanel.js: (WebInspector.TimelinePanel.FormattedRecord): (WebInspector.TimelinePanel.FormattedRecord.prototype._generatePopupContent): (WebInspector.TimelinePanel.FormattedRecord.prototype._getRecordDetails): (WebInspector.TimelinePanel.PopupContentHelper.prototype._appendElementRow): (WebInspector.TimelinePanel.PopupContentHelper.prototype._appendLinkRow): (WebInspector.TimelinePanel.PopupContentHelper.prototype._appendStackTrace):
  • inspector/front-end/inspector.css: (.timeline-details): (.timeline-function-name): (.timeline-stacktrace-title):
Location:
trunk/WebCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r63753 r63757  
     12010-07-20  Ilya Tikhonovsky  <loislo@chromium.org>
     2
     3        Reviewed by Pavel Feldman.
     4
     5        WebInspector: It is possible to show full call stack instead of top frame for Caller
     6        and Call Site properties in Timeline panel.
     7        https://bugs.webkit.org/show_bug.cgi?id=42620
     8
     9        * English.lproj/localizedStrings.js:
     10        * inspector/front-end/TimelinePanel.js:
     11        (WebInspector.TimelinePanel.FormattedRecord):
     12        (WebInspector.TimelinePanel.FormattedRecord.prototype._generatePopupContent):
     13        (WebInspector.TimelinePanel.FormattedRecord.prototype._getRecordDetails):
     14        (WebInspector.TimelinePanel.PopupContentHelper.prototype._appendElementRow):
     15        (WebInspector.TimelinePanel.PopupContentHelper.prototype._appendLinkRow):
     16        (WebInspector.TimelinePanel.PopupContentHelper.prototype._appendStackTrace):
     17        * inspector/front-end/inspector.css:
     18        (.timeline-details):
     19        (.timeline-function-name):
     20        (.timeline-stacktrace-title):
     21
    1222010-07-20  Leon Clarke  <leonclarke@google.com>
    223
  • trunk/WebCore/inspector/front-end/TimelinePanel.js

    r62647 r63757  
    842842    this._lastChildEndTime = this.endTime;
    843843    this.originalRecordForTests = record;
    844     if (record.stackTrace && record.stackTrace.length) {
    845         this.callerScriptName = record.stackTrace[0].scriptName;
    846         this.callerScriptLine = record.stackTrace[0].lineNumber;
    847     }
     844    if (record.stackTrace && record.stackTrace.length)
     845        this.stackTrace = record.stackTrace;
    848846    this.totalHeapSize = record.totalHeapSize;
    849847    this.usedHeapSize = record.usedHeapSize;
     
    878876        var timerInstalledRecord = panel._timerRecords[record.data.timerId];
    879877        if (timerInstalledRecord) {
    880             this.callSiteScriptName = timerInstalledRecord.callerScriptName;
    881             this.callSiteScriptLine = timerInstalledRecord.callerScriptLine;
     878            this.callSiteStackTrace = timerInstalledRecord.stackTrace;
    882879            this.timeout = timerInstalledRecord.timeout;
    883880            this.singleShot = timerInstalledRecord.singleShot;
     
    941938                    contentHelper._appendTextRow(WebInspector.UIString("Repeats"), !this.singleShot);
    942939                }
    943                 if (typeof this.callSiteScriptLine === "number")
    944                     contentHelper._appendLinkRow(WebInspector.UIString("Call Site"), this.callSiteScriptName, this.callSiteScriptLine);
    945940                break;
    946941            case recordTypes.FunctionCall:
     
    980975            contentHelper._appendLinkRow(WebInspector.UIString("Function Call"), this.data.scriptName, this.data.scriptLine);
    981976
    982         if (this.callerScriptName && this.type !== recordTypes.GCEvent)
    983             contentHelper._appendLinkRow(WebInspector.UIString("Caller"), this.callerScriptName, this.callerScriptLine);
    984 
    985977        if (this.usedHeapSize)
    986978            contentHelper._appendTextRow(WebInspector.UIString("Used Heap Size"), WebInspector.UIString("%s of %s", Number.bytesToString(this.usedHeapSize, WebInspector.UIString), Number.bytesToString(this.totalHeapSize, WebInspector.UIString)));
     979
     980        if (this.callSiteStackTrace && this.callSiteStackTrace.length)
     981            contentHelper._appendStackTrace(WebInspector.UIString("Call Site stack"), this.callSiteStackTrace);
     982
     983        if (this.stackTrace)
     984            contentHelper._appendStackTrace(WebInspector.UIString("Call Stack"), this.stackTrace);
    987985
    988986        return contentHelper._contentTable;
     
    10041002            case WebInspector.TimelineAgent.RecordType.TimerInstall:
    10051003            case WebInspector.TimelineAgent.RecordType.TimerRemove:
    1006                 return this.callerScriptName ? WebInspector.linkifyResourceAsNode(this.callerScriptName, "scripts", this.callerScriptLine, "", "") : record.data.timerId;
     1004                return this.stackTrace ? WebInspector.linkifyResourceAsNode(this.stackTrace[0].scriptName, "scripts", this.stackTrace[0].lineNumber, "", "") : record.data.timerId;
    10071005            case WebInspector.TimelineAgent.RecordType.ParseHTML:
    10081006            case WebInspector.TimelineAgent.RecordType.RecalculateStyles:
    1009                 return this.callerScriptName ? WebInspector.linkifyResourceAsNode(this.callerScriptName, "scripts", this.callerScriptLine, "", "") : null;
     1007                return this.stackTrace ? WebInspector.linkifyResourceAsNode(this.stackTrace[0].scriptName, "scripts", this.stackTrace[0].lineNumber, "", "") : null;
    10101008            case WebInspector.TimelineAgent.RecordType.EvaluateScript:
    10111009                return record.data.url ? WebInspector.linkifyResourceAsNode(record.data.url, "scripts", record.data.lineNumber, "", "") : null;
     
    10761074    },
    10771075
    1078     _appendElementRow: function(title, content)
     1076    _appendElementRow: function(title, content, titleStyle)
    10791077    {
    10801078        var row = document.createElement("tr");
    1081         row.appendChild(this._createCell(title, "timeline-details-row-title"));
     1079        var titleCell = this._createCell(title, "timeline-details-row-title");
     1080        if (titleStyle)
     1081            titleCell.addStyleClass(titleStyle);
     1082        row.appendChild(titleCell);
    10821083        var cell = document.createElement("td");
     1084        cell.className = "timeline-details";
    10831085        cell.appendChild(content);
    10841086        row.appendChild(cell);
     
    10901092        var link = WebInspector.linkifyResourceAsNode(scriptName, "scripts", scriptLine, "timeline-details");
    10911093        this._appendElementRow(title, link);
     1094    },
     1095
     1096    _appendStackTrace: function(title, stackTrace)
     1097    {
     1098        this._appendTextRow("", "");
     1099        var framesTable = document.createElement("table");
     1100        for (var i = 0; i < stackTrace.length; ++i) {
     1101            var stackFrame = stackTrace[i];
     1102            var row = document.createElement("tr");
     1103            row.className = "timeline-details";
     1104            row.appendChild(this._createCell(stackFrame.functionName ? stackFrame.functionName : WebInspector.UIString("(anonymous function)"), "timeline-function-name"));
     1105            row.appendChild(this._createCell(" @ "));
     1106            var linkCell = document.createElement("td");
     1107            linkCell.appendChild(WebInspector.linkifyResourceAsNode(stackFrame.scriptName, "scripts", stackFrame.lineNumber, "timeline-details"));
     1108            row.appendChild(linkCell);
     1109            framesTable.appendChild(row);
     1110        }
     1111        this._appendElementRow(title, framesTable, "timeline-stacktrace-title");
    10921112    }
    10931113}
  • trunk/WebCore/inspector/front-end/inspector.css

    r63662 r63757  
    36943694.timeline-details {
    36953695    -webkit-user-select: text;
     3696    vertical-align: top;
     3697}
     3698
     3699.timeline-function-name {
     3700    text-align: right;
     3701}
     3702
     3703.timeline-stacktrace-title {
     3704    padding-top: 4px;
    36963705}
    36973706
Note: See TracChangeset for help on using the changeset viewer.