Chromium Code Reviews| Index: third_party/WebKit/Source/devtools/front_end/timeline/TimelineUIUtils.js |
| diff --git a/third_party/WebKit/Source/devtools/front_end/timeline/TimelineUIUtils.js b/third_party/WebKit/Source/devtools/front_end/timeline/TimelineUIUtils.js |
| index cf40c9bd06079fa4d1251a78a6e0c9277a8f3558..7e828ab9de600c5b385dcd4d1b2f8ecd96b61d59 100644 |
| --- a/third_party/WebKit/Source/devtools/front_end/timeline/TimelineUIUtils.js |
| +++ b/third_party/WebKit/Source/devtools/front_end/timeline/TimelineUIUtils.js |
| @@ -216,6 +216,29 @@ WebInspector.TimelineUIUtils.isMarkerEvent = function(event) |
| } |
| /** |
| + * @param {!ConsoleAgent.CallFrame} frame |
| + * @return {boolean} |
| + */ |
| +WebInspector.TimelineUIUtils.isUserFrame = function(frame) |
| +{ |
| + if (frame.url.startsWith("native ")) |
| + return false; |
| + if (!frame.url && frame.scriptId === "0") |
| + return false; |
| + return true; |
| +} |
| + |
| +/** |
| + * @param {!WebInspector.TracingModel.Event} event |
| + * @return {?ConsoleAgent.CallFrame} |
| + */ |
| +WebInspector.TimelineUIUtils.topUserFrame = function(event) |
|
caseq
2016/01/27 23:03:56
is this still necessary?
alph
2016/01/27 23:16:20
Acknowledged.
|
| +{ |
| + var stackTrace = event.stackTrace || event.initiator && event.initiator.stackTrace; |
| + return stackTrace && stackTrace.find(WebInspector.TimelineUIUtils.isUserFrame) || null; |
| +} |
| + |
| +/** |
| * @enum {symbol} |
| */ |
| WebInspector.TimelineUIUtils.NetworkCategory = { |
| @@ -383,16 +406,8 @@ WebInspector.TimelineUIUtils.buildDetailsTextForTraceEvent = function(event, tar |
| */ |
| function linkifyTopCallFrameAsText() |
| { |
| - var stackTrace = event.stackTrace; |
| - if (!stackTrace) { |
| - var initiator = event.initiator; |
| - if (initiator) |
| - stackTrace = initiator.stackTrace; |
| - } |
| - if (!stackTrace || !stackTrace.length) |
| - return null; |
| - var callFrame = stackTrace[0]; |
| - return linkifyLocationAsText(callFrame.scriptId, callFrame.lineNumber, callFrame.columnNumber); |
| + var frame = WebInspector.TimelineUIUtils.topUserFrame(event); |
| + return frame ? linkifyLocationAsText(frame.scriptId, frame.lineNumber, frame.columnNumber) : null; |
| } |
| } |
| @@ -487,15 +502,8 @@ WebInspector.TimelineUIUtils.buildDetailsNodeForTraceEvent = function(event, tar |
| */ |
| function linkifyTopCallFrame() |
| { |
| - var stackTrace = event.stackTrace; |
| - if (!stackTrace) { |
| - var initiator = event.initiator; |
| - if (initiator) |
| - stackTrace = initiator.stackTrace; |
| - } |
| - if (!stackTrace || !stackTrace.length) |
| - return null; |
| - return linkifier.linkifyConsoleCallFrame(target, stackTrace[0], "timeline-details"); |
| + var frame = WebInspector.TimelineUIUtils.topUserFrame(event); |
| + return frame ? linkifier.linkifyConsoleCallFrame(target, frame, "timeline-details") : null; |
| } |
| } |