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

Side by Side Diff: Source/devtools/front_end/timeline/TimelineTreeView.js

Issue 1295403002: DevTools: [timeline tree view] Auto update sort columns on view type change. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 4 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 | « no previous file | 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 /** 5 /**
6 * @constructor 6 * @constructor
7 * @extends {WebInspector.VBox} 7 * @extends {WebInspector.VBox}
8 * @param {!WebInspector.TimelineModel} model 8 * @param {!WebInspector.TimelineModel} model
9 */ 9 */
10 WebInspector.TimelineTreeView = function(model) 10 WebInspector.TimelineTreeView = function(model)
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 { 108 {
109 this._groupBySetting.set(this._groupByCombobox.selectedOption().value); 109 this._groupBySetting.set(this._groupByCombobox.selectedOption().value);
110 this._refreshTree(); 110 this._refreshTree();
111 }, 111 },
112 112
113 _refreshTree: function() 113 _refreshTree: function()
114 { 114 {
115 this.dataGrid.rootNode().removeChildren(); 115 this.dataGrid.rootNode().removeChildren();
116 var topDown = WebInspector.TimelineModel.buildTopDownTree( 116 var topDown = WebInspector.TimelineModel.buildTopDownTree(
117 this._model.mainThreadEvents(), this._startTime, this._endTime, this ._filters, WebInspector.TimelineTreeView.eventId); 117 this._model.mainThreadEvents(), this._startTime, this._endTime, this ._filters, WebInspector.TimelineTreeView.eventId);
118 var tree = this._modeCombobox.selectedOption().value === WebInspector.Ti melineTreeView.Mode.TopDown 118 var isTopDown = this._modeCombobox.selectedOption().value === WebInspect or.TimelineTreeView.Mode.TopDown;
119 ? this._preformTopDownTreeGrouping(topDown) 119 var tree = isTopDown ? this._preformTopDownTreeGrouping(topDown) : this. _buildBottomUpTree(topDown);
120 : this._buildBottomUpTree(topDown); 120 this.dataGrid.markColumnAsSortedBy(isTopDown ? "total" : "self", WebInsp ector.DataGrid.Order.Descending);
121 var maxSelfTime = 0; 121 var maxSelfTime = 0;
122 var maxTotalTime = 0; 122 var maxTotalTime = 0;
123 for (var child of tree.children.values()) { 123 for (var child of tree.children.values()) {
124 maxSelfTime = Math.max(maxSelfTime, child.selfTime); 124 maxSelfTime = Math.max(maxSelfTime, child.selfTime);
125 maxTotalTime = Math.max(maxTotalTime, child.totalTime); 125 maxTotalTime = Math.max(maxTotalTime, child.totalTime);
126 } 126 }
127 for (var child of tree.children.values()) { 127 for (var child of tree.children.values()) {
128 // Exclude the idle time off the total calculation. 128 // Exclude the idle time off the total calculation.
129 var gridNode = new WebInspector.TimelineTreeView.GridNode(child, top Down.totalTime, maxSelfTime, maxTotalTime); 129 var gridNode = new WebInspector.TimelineTreeView.GridNode(child, top Down.totalTime, maxSelfTime, maxTotalTime);
130 this.dataGrid.insertChild(gridNode); 130 this.dataGrid.insertChild(gridNode);
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after
414 if (!this._profileNode.children) 414 if (!this._profileNode.children)
415 return; 415 return;
416 for (var node of this._profileNode.children.values()) { 416 for (var node of this._profileNode.children.values()) {
417 var gridNode = new WebInspector.TimelineTreeView.GridNode(node, this ._totalTime, this._maxTimes.self, this._maxTimes.total); 417 var gridNode = new WebInspector.TimelineTreeView.GridNode(node, this ._totalTime, this._maxTimes.self, this._maxTimes.total);
418 this.insertChildOrdered(gridNode); 418 this.insertChildOrdered(gridNode);
419 } 419 }
420 }, 420 },
421 421
422 __proto__: WebInspector.SortableDataGridNode.prototype 422 __proto__: WebInspector.SortableDataGridNode.prototype
423 } 423 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698