| 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 |
| 5 TimelineModel.TimelineProfileTree = {}; | 5 TimelineModel.TimelineProfileTree = {}; |
| 6 | 6 |
| 7 /** | 7 /** |
| 8 * @unrestricted | 8 * @unrestricted |
| 9 */ | 9 */ |
| 10 TimelineModel.TimelineProfileTree.Node = class { | 10 TimelineModel.TimelineProfileTree.Node = class { |
| (...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 243 */ | 243 */ |
| 244 children() { | 244 children() { |
| 245 return this._children || this._grouppedTopNodes(); | 245 return this._children || this._grouppedTopNodes(); |
| 246 } | 246 } |
| 247 | 247 |
| 248 /** | 248 /** |
| 249 * @return {!Map<string, !TimelineModel.TimelineProfileTree.Node>} | 249 * @return {!Map<string, !TimelineModel.TimelineProfileTree.Node>} |
| 250 */ | 250 */ |
| 251 _grouppedTopNodes() { | 251 _grouppedTopNodes() { |
| 252 var flatNodes = super.children(); | 252 var flatNodes = super.children(); |
| 253 for (var node of flatNodes.values()) |
| 254 this.selfTime -= node.totalTime; |
| 253 if (!this._eventGroupIdCallback) | 255 if (!this._eventGroupIdCallback) |
| 254 return flatNodes; | 256 return flatNodes; |
| 255 var groupNodes = new Map(); | 257 var groupNodes = new Map(); |
| 256 for (var node of flatNodes.values()) { | 258 for (var node of flatNodes.values()) { |
| 257 var groupId = this._eventGroupIdCallback(/** @type {!SDK.TracingModel.Even
t} */ (node.event)); | 259 var groupId = this._eventGroupIdCallback(/** @type {!SDK.TracingModel.Even
t} */ (node.event)); |
| 258 var groupNode = groupNodes.get(groupId); | 260 var groupNode = groupNodes.get(groupId); |
| 259 if (!groupNode) { | 261 if (!groupNode) { |
| 260 groupNode = new TimelineModel.TimelineProfileTree.GroupNode( | 262 groupNode = new TimelineModel.TimelineProfileTree.GroupNode( |
| 261 groupId, this, /** @type {!SDK.TracingModel.Event} */ (node.event)); | 263 groupId, this, /** @type {!SDK.TracingModel.Event} */ (node.event)); |
| 262 groupNodes.set(groupId, groupNode); | 264 groupNodes.set(groupId, groupNode); |
| (...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 572 if (event.name !== TimelineModel.TimelineModel.RecordType.JSFrame) | 574 if (event.name !== TimelineModel.TimelineModel.RecordType.JSFrame) |
| 573 return event.name; | 575 return event.name; |
| 574 const frame = event.args['data']; | 576 const frame = event.args['data']; |
| 575 const location = frame['scriptId'] || frame['url'] || ''; | 577 const location = frame['scriptId'] || frame['url'] || ''; |
| 576 const functionName = frame['functionName']; | 578 const functionName = frame['functionName']; |
| 577 const name = TimelineModel.TimelineJSProfileProcessor.isNativeRuntimeFrame(fra
me) ? | 579 const name = TimelineModel.TimelineJSProfileProcessor.isNativeRuntimeFrame(fra
me) ? |
| 578 TimelineModel.TimelineJSProfileProcessor.nativeGroup(functionName) || func
tionName : | 580 TimelineModel.TimelineJSProfileProcessor.nativeGroup(functionName) || func
tionName : |
| 579 functionName; | 581 functionName; |
| 580 return `f:${name}@${location}`; | 582 return `f:${name}@${location}`; |
| 581 }; | 583 }; |
| OLD | NEW |