| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 WebInspector.TimelineProfileTree = {}; | 4 WebInspector.TimelineProfileTree = {}; |
| 5 | 5 |
| 6 /** | 6 /** |
| 7 * @unrestricted | 7 * @unrestricted |
| 8 */ | 8 */ |
| 9 WebInspector.TimelineProfileTree.Node = class { | 9 WebInspector.TimelineProfileTree.Node = class { |
| 10 constructor() { | 10 constructor() { |
| (...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 202 return null; | 202 return null; |
| 203 }; | 203 }; |
| 204 | 204 |
| 205 /** | 205 /** |
| 206 * @param {!WebInspector.TracingModel.Event} event | 206 * @param {!WebInspector.TracingModel.Event} event |
| 207 * @return {?Protocol.Runtime.CallFrame} | 207 * @return {?Protocol.Runtime.CallFrame} |
| 208 */ | 208 */ |
| 209 WebInspector.TimelineProfileTree.eventStackFrame = function(event) { | 209 WebInspector.TimelineProfileTree.eventStackFrame = function(event) { |
| 210 if (event.name === WebInspector.TimelineModel.RecordType.JSFrame) | 210 if (event.name === WebInspector.TimelineModel.RecordType.JSFrame) |
| 211 return /** @type {?Protocol.Runtime.CallFrame} */ (event.args['data'] || nul
l); | 211 return /** @type {?Protocol.Runtime.CallFrame} */ (event.args['data'] || nul
l); |
| 212 var topFrame = event.stackTrace && event.stackTrace[0]; | 212 return WebInspector.TimelineData.forEvent(event).topFrame(); |
| 213 if (topFrame) | |
| 214 return /** @type {!Protocol.Runtime.CallFrame} */ (topFrame); | |
| 215 var initiator = event.initiator; | |
| 216 return /** @type {?Protocol.Runtime.CallFrame} */ (initiator && initiator.stac
kTrace && initiator.stackTrace[0] || null); | |
| 217 }; | 213 }; |
| 218 | 214 |
| 219 /** | 215 /** |
| 220 * @param {!WebInspector.TracingModel.Event} event | 216 * @param {!WebInspector.TracingModel.Event} event |
| 221 * @return {string} | 217 * @return {string} |
| 222 */ | 218 */ |
| 223 WebInspector.TimelineProfileTree._eventId = function(event) { | 219 WebInspector.TimelineProfileTree._eventId = function(event) { |
| 224 if (event.name === WebInspector.TimelineModel.RecordType.JSFrame) { | 220 if (event.name === WebInspector.TimelineModel.RecordType.JSFrame) { |
| 225 var data = event.args['data']; | 221 var data = event.args['data']; |
| 226 return 'f:' + data['functionName'] + '@' + (data['scriptId'] || data['url']
|| ''); | 222 return 'f:' + data['functionName'] + '@' + (data['scriptId'] || data['url']
|| ''); |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 277 groupNode.totalTime = 0; | 273 groupNode.totalTime = 0; |
| 278 groupNode.children = new Map(); | 274 groupNode.children = new Map(); |
| 279 groupNode.event = event; | 275 groupNode.event = event; |
| 280 groupNode._isGroupNode = true; | 276 groupNode._isGroupNode = true; |
| 281 this._groupNodes.set(id, groupNode); | 277 this._groupNodes.set(id, groupNode); |
| 282 return groupNode; | 278 return groupNode; |
| 283 } | 279 } |
| 284 }; | 280 }; |
| 285 | 281 |
| 286 WebInspector.TimelineAggregator._groupNodeFlag = Symbol('groupNode'); | 282 WebInspector.TimelineAggregator._groupNodeFlag = Symbol('groupNode'); |
| OLD | NEW |