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