Skip to content

Commit

Permalink
Timeline: move eventStackFrame from TimelineTreeView to TimelineProfi…
Browse files Browse the repository at this point in the history
…leTree

This is a follow-up to https://codereview.chromium.org/1779053002 that fixes
a layering violation that accidentally creeped into the original CL.

[email protected],[email protected]

Review URL: https://codereview.chromium.org/1778233003

Cr-Commit-Position: refs/heads/master@{#380337}
  • Loading branch information
caseq authored and Commit bot committed Mar 10, 2016
1 parent f46adb2 commit b4cc6f0
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
17 changes: 16 additions & 1 deletion front_end/timeline/TimelineProfileTree.js
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ WebInspector.TimelineProfileTree.eventURL = function(event)
var data = event.args["data"] || event.args["beginData"];
if (data && data["url"])
return data["url"];
var frame = WebInspector.TimelineTreeView.eventStackFrame(event);
var frame = WebInspector.TimelineProfileTree.eventStackFrame(event);
while (frame) {
var url = frame["url"];
if (url)
Expand All @@ -201,6 +201,21 @@ WebInspector.TimelineProfileTree.eventURL = function(event)
return null;
}

/**
* @param {!WebInspector.TracingModel.Event} event
* @return {?Object}
*/
WebInspector.TimelineProfileTree.eventStackFrame = function(event)
{
if (event.name == WebInspector.TimelineModel.RecordType.JSFrame)
return event.args["data"];
var topFrame = event.stackTrace && event.stackTrace[0];
if (topFrame)
return topFrame;
var initiator = event.initiator;
return initiator && initiator.stackTrace && initiator.stackTrace[0] || null;
}

/**
* @constructor
* @param {function(!WebInspector.TracingModel.Event):string} categoryMapper
Expand Down
17 changes: 1 addition & 16 deletions front_end/timeline/TimelineTreeView.js
Original file line number Diff line number Diff line change
Expand Up @@ -290,21 +290,6 @@ WebInspector.TimelineTreeView.eventNameForSorting = function(event)
return event.name + ":@" + WebInspector.TimelineProfileTree.eventURL(event);
}

/**
* @param {!WebInspector.TracingModel.Event} event
* @return {?Object}
*/
WebInspector.TimelineTreeView.eventStackFrame = function(event)
{
if (event.name == WebInspector.TimelineModel.RecordType.JSFrame)
return event.args["data"];
var topFrame = event.stackTrace && event.stackTrace[0];
if (topFrame)
return topFrame;
var initiator = event.initiator;
return initiator && initiator.stackTrace && initiator.stackTrace[0] || null;
}

/**
* @constructor
* @extends {WebInspector.SortableDataGridNode}
Expand Down Expand Up @@ -362,7 +347,7 @@ WebInspector.TimelineTreeView.GridNode.prototype = {
name.textContent = event.name === WebInspector.TimelineModel.RecordType.JSFrame
? WebInspector.beautifyFunctionName(event.args["data"]["functionName"])
: WebInspector.TimelineUIUtils.eventTitle(event);
var frame = WebInspector.TimelineTreeView.eventStackFrame(event);
var frame = WebInspector.TimelineProfileTree.eventStackFrame(event);
if (frame && frame["url"]) {
var callFrame = /** @type {!RuntimeAgent.CallFrame} */ (frame);
container.createChild("div", "activity-link").appendChild(this._treeView.linkifyLocation(callFrame));
Expand Down

0 comments on commit b4cc6f0

Please sign in to comment.