Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(550)

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/timeline_model/TimelineProfileTree.js

Issue 2829923002: DevTools: Base aggregated tree view percentage on the busy time. (Closed)
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/devtools/front_end/timeline/timelinePanel.css ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 this.selfTime -= Array.from(flatNodes.values()).reduce((acc, node) => acc + node.totalTime, 0);
pfeldman 2017/04/21 20:10:09 Are you implementing this? for (var node of flatN
alph 2017/04/21 20:19:59 Done.
253 if (!this._eventGroupIdCallback) 254 if (!this._eventGroupIdCallback)
254 return flatNodes; 255 return flatNodes;
255 var groupNodes = new Map(); 256 var groupNodes = new Map();
256 for (var node of flatNodes.values()) { 257 for (var node of flatNodes.values()) {
257 var groupId = this._eventGroupIdCallback(/** @type {!SDK.TracingModel.Even t} */ (node.event)); 258 var groupId = this._eventGroupIdCallback(/** @type {!SDK.TracingModel.Even t} */ (node.event));
258 var groupNode = groupNodes.get(groupId); 259 var groupNode = groupNodes.get(groupId);
259 if (!groupNode) { 260 if (!groupNode) {
260 groupNode = new TimelineModel.TimelineProfileTree.GroupNode( 261 groupNode = new TimelineModel.TimelineProfileTree.GroupNode(
261 groupId, this, /** @type {!SDK.TracingModel.Event} */ (node.event)); 262 groupId, this, /** @type {!SDK.TracingModel.Event} */ (node.event));
262 groupNodes.set(groupId, groupNode); 263 groupNodes.set(groupId, groupNode);
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after
572 if (event.name !== TimelineModel.TimelineModel.RecordType.JSFrame) 573 if (event.name !== TimelineModel.TimelineModel.RecordType.JSFrame)
573 return event.name; 574 return event.name;
574 const frame = event.args['data']; 575 const frame = event.args['data'];
575 const location = frame['scriptId'] || frame['url'] || ''; 576 const location = frame['scriptId'] || frame['url'] || '';
576 const functionName = frame['functionName']; 577 const functionName = frame['functionName'];
577 const name = TimelineModel.TimelineJSProfileProcessor.isNativeRuntimeFrame(fra me) ? 578 const name = TimelineModel.TimelineJSProfileProcessor.isNativeRuntimeFrame(fra me) ?
578 TimelineModel.TimelineJSProfileProcessor.nativeGroup(functionName) || func tionName : 579 TimelineModel.TimelineJSProfileProcessor.nativeGroup(functionName) || func tionName :
579 functionName; 580 functionName;
580 return `f:${name}@${location}`; 581 return `f:${name}@${location}`;
581 }; 582 };
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/devtools/front_end/timeline/timelinePanel.css ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698