| 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 1f8010cc438a373ec4be7777a8204589ccb43ef8..46afbb2a359bb8fd28b0859a71bc313389824ae3 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,31 @@ 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)
|
| +{
|
| + var stackTrace = event.stackTrace;
|
| + if (!stackTrace && event.initiator)
|
| + stackTrace = event.initiator.stackTrace;
|
| + return stackTrace && stackTrace.find(WebInspector.TimelineUIUtils.isUserFrame) || null;
|
| +}
|
| +
|
| +/**
|
| * @enum {symbol}
|
| */
|
| WebInspector.TimelineUIUtils.NetworkCategory = {
|
| @@ -383,16 +408,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 +504,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;
|
| }
|
| }
|
|
|
|
|