| 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 |
| 4 WebInspector.TimelineProfileTree = {}; | 5 WebInspector.TimelineProfileTree = {}; |
| 5 | 6 |
| 6 /** | 7 /** |
| 7 * @unrestricted | 8 * @unrestricted |
| 8 */ | 9 */ |
| 9 WebInspector.TimelineProfileTree.Node = class { | 10 WebInspector.TimelineProfileTree.Node = class { |
| 10 constructor() { | 11 constructor() { |
| 11 /** @type {number} */ | 12 /** @type {number} */ |
| 12 this.totalTime; | 13 this.totalTime; |
| 13 /** @type {number} */ | 14 /** @type {number} */ |
| (...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 210 if (event.name === WebInspector.TimelineModel.RecordType.JSFrame) | 211 if (event.name === WebInspector.TimelineModel.RecordType.JSFrame) |
| 211 return /** @type {?Protocol.Runtime.CallFrame} */ (event.args['data'] || nul
l); | 212 return /** @type {?Protocol.Runtime.CallFrame} */ (event.args['data'] || nul
l); |
| 212 return WebInspector.TimelineData.forEvent(event).topFrame(); | 213 return WebInspector.TimelineData.forEvent(event).topFrame(); |
| 213 }; | 214 }; |
| 214 | 215 |
| 215 /** | 216 /** |
| 216 * @param {!WebInspector.TracingModel.Event} event | 217 * @param {!WebInspector.TracingModel.Event} event |
| 217 * @return {string} | 218 * @return {string} |
| 218 */ | 219 */ |
| 219 WebInspector.TimelineProfileTree._eventId = function(event) { | 220 WebInspector.TimelineProfileTree._eventId = function(event) { |
| 220 if (event.name === WebInspector.TimelineModel.RecordType.JSFrame) { | 221 if (event.name !== WebInspector.TimelineModel.RecordType.JSFrame) |
| 221 var data = event.args['data']; | 222 return event.name; |
| 222 return 'f:' + data['functionName'] + '@' + (data['scriptId'] || data['url']
|| ''); | 223 const frame = event.args['data']; |
| 223 } | 224 const location = frame['scriptId'] || frame['url'] || ''; |
| 224 return event.name; | 225 const functionName = frame['functionName']; |
| 226 const name = WebInspector.TimelineJSProfileProcessor.isNativeRuntimeFrame(fram
e) |
| 227 ? WebInspector.TimelineJSProfileProcessor.nativeGroup(functionName) || fun
ctionName |
| 228 : functionName; |
| 229 return `f:${name}@${location}`; |
| 225 }; | 230 }; |
| 226 | 231 |
| 227 | |
| 228 /** | 232 /** |
| 229 * @unrestricted | 233 * @unrestricted |
| 230 */ | 234 */ |
| 231 WebInspector.TimelineAggregator = class { | 235 WebInspector.TimelineAggregator = class { |
| 232 constructor() { | 236 constructor() { |
| 233 /** @type {!Map<string, !WebInspector.TimelineProfileTree.Node>} */ | 237 /** @type {!Map<string, !WebInspector.TimelineProfileTree.Node>} */ |
| 234 this._groupNodes = new Map(); | 238 this._groupNodes = new Map(); |
| 235 } | 239 } |
| 236 | 240 |
| 237 /** | 241 /** |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 273 groupNode.totalTime = 0; | 277 groupNode.totalTime = 0; |
| 274 groupNode.children = new Map(); | 278 groupNode.children = new Map(); |
| 275 groupNode.event = event; | 279 groupNode.event = event; |
| 276 groupNode._isGroupNode = true; | 280 groupNode._isGroupNode = true; |
| 277 this._groupNodes.set(id, groupNode); | 281 this._groupNodes.set(id, groupNode); |
| 278 return groupNode; | 282 return groupNode; |
| 279 } | 283 } |
| 280 }; | 284 }; |
| 281 | 285 |
| 282 WebInspector.TimelineAggregator._groupNodeFlag = Symbol('groupNode'); | 286 WebInspector.TimelineAggregator._groupNodeFlag = Symbol('groupNode'); |
| OLD | NEW |