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 6ba342d40375c089eb692b61f526bee759a5f4a4..4cf270af04bf76b18cd59b5aa2bd23da74ad9412 100644 |
| --- a/third_party/WebKit/Source/devtools/front_end/timeline/TimelineUIUtils.js |
| +++ b/third_party/WebKit/Source/devtools/front_end/timeline/TimelineUIUtils.js |
| @@ -219,7 +219,7 @@ WebInspector.TimelineUIUtils.isMarkerEvent = function(event) |
| } |
| /** |
| - * @param {!ConsoleAgent.CallFrame} frame |
| + * @param {!RuntimeAgent.CallFrame} frame |
| * @return {boolean} |
| */ |
| WebInspector.TimelineUIUtils.isUserFrame = function(frame) |
| @@ -229,12 +229,14 @@ WebInspector.TimelineUIUtils.isUserFrame = function(frame) |
| /** |
| * @param {!WebInspector.TracingModel.Event} event |
| - * @return {?ConsoleAgent.CallFrame} |
| + * @return {?RuntimeAgent.CallFrame} |
| */ |
| WebInspector.TimelineUIUtils.topStackFrame = function(event) |
| { |
| - var stackTrace = event.stackTrace || event.initiator && event.initiator.stackTrace; |
| - return stackTrace && stackTrace.length ? stackTrace[0] : null; |
| + var callFrames = event.stackTrace; |
| + if (!callFrames) |
| + callFrames = event.initiator && event.initiator.stack ? event.initiator.stack.callFrames : null; |
|
dgozman
2016/02/04 01:43:06
Double-check.
pfeldman
2016/02/04 03:16:00
Done.
|
| + return callFrames && callFrames.length ? callFrames[0] : null; |
| } |
| /** |
| @@ -747,7 +749,7 @@ WebInspector.TimelineUIUtils._buildTraceEventDetailsSynchronously = function(eve |
| contentHelper.appendElementRow("", event.previewElement); |
| } |
| - if (event.stackTrace || (event.initiator && event.initiator.stackTrace) || event.invalidationTrackingEvents) |
| + if (event.stackTrace || (event.initiator && event.initiator.stack) || event.invalidationTrackingEvents) |
| WebInspector.TimelineUIUtils._generateCauses(event, model.target(), relatedNodesMap, contentHelper); |
| var showPieChart = detailed && WebInspector.TimelineUIUtils._aggregatedStatsForTraceEvent(stats, model, event); |
| @@ -920,6 +922,15 @@ WebInspector.TimelineUIUtils.buildNetworkRequestDetails = function(request, mode |
| } |
| /** |
| + * @param {!Array<!RuntimeAgent.CallFrame>} callFrames |
| + * @return {!RuntimeAgent.StackTrace} |
| + */ |
| +WebInspector.TimelineUIUtils._stackTraceFromCallFrames = function(callFrames) |
| +{ |
| + return /** @type {!RuntimeAgent.StackTrace} */ ({ callFrames: callFrames }); |
| +} |
| + |
| +/** |
| * @param {!WebInspector.TracingModel.Event} event |
| * @param {?WebInspector.Target} target |
| * @param {?Map<number, ?WebInspector.DOMNode>} relatedNodesMap |
| @@ -956,15 +967,15 @@ WebInspector.TimelineUIUtils._generateCauses = function(event, target, relatedNo |
| // Direct cause. |
| if (event.stackTrace && event.stackTrace.length) { |
| contentHelper.addSection(WebInspector.UIString("Call Stacks")); |
| - contentHelper.appendStackTrace(stackLabel || WebInspector.UIString("Stack Trace"), event.stackTrace); |
| + contentHelper.appendStackTrace(stackLabel || WebInspector.UIString("Stack Trace"), WebInspector.TimelineUIUtils._stackTraceFromCallFrames(event.stackTrace)); |
| } |
| // Indirect causes. |
| if (event.invalidationTrackingEvents && target) { // Full invalidation tracking (experimental). |
| contentHelper.addSection(WebInspector.UIString("Invalidations")); |
| WebInspector.TimelineUIUtils._generateInvalidations(event, target, relatedNodesMap, contentHelper); |
| - } else if (initiator && initiator.stackTrace) { // Partial invalidation tracking. |
| - contentHelper.appendStackTrace(callSiteStackLabel || WebInspector.UIString("First Invalidated"), initiator.stackTrace); |
| + } else if (initiator && initiator.stack) { // Partial invalidation tracking. |
| + contentHelper.appendStackTrace(callSiteStackLabel || WebInspector.UIString("First Invalidated"), initiator.stack); |
| } |
| } |
| @@ -1132,7 +1143,7 @@ WebInspector.TimelineUIUtils.InvalidationsGroupElement.prototype = { |
| if (first.cause.stackTrace) { |
| var stack = content.createChild("div"); |
| stack.createTextChild(WebInspector.UIString("Stack trace:")); |
| - this._contentHelper.createChildStackTraceElement(stack, first.cause.stackTrace); |
| + this._contentHelper.createChildStackTraceElement(stack, WebInspector.TimelineUIUtils._stackTraceFromCallFrames(first.cause.stackTrace)); |
| } |
| content.createTextChild(this._invalidations.length > 1 ? WebInspector.UIString("Nodes:") : WebInspector.UIString("Node:")); |
| @@ -1952,7 +1963,7 @@ WebInspector.TimelineDetailsContentHelper.prototype = { |
| /** |
| * @param {string} title |
| - * @param {!Array.<!ConsoleAgent.CallFrame>} stackTrace |
| + * @param {!RuntimeAgent.StackTrace} stackTrace |
| */ |
| appendStackTrace: function(title, stackTrace) |
| { |
| @@ -1966,7 +1977,7 @@ WebInspector.TimelineDetailsContentHelper.prototype = { |
| /** |
| * @param {!Element} parentElement |
| - * @param {!Array.<!ConsoleAgent.CallFrame>} stackTrace |
| + * @param {!RuntimeAgent.StackTrace} stackTrace |
| */ |
| createChildStackTraceElement: function(parentElement, stackTrace) |
| { |