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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/timeline/TimelineTreeView.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 | « no previous file | third_party/WebKit/Source/devtools/front_end/timeline/timelinePanel.css » ('j') | 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 * @unrestricted 6 * @unrestricted
7 * @implements {UI.Searchable} 7 * @implements {UI.Searchable}
8 */ 8 */
9 Timeline.TimelineTreeView = class extends UI.VBox { 9 Timeline.TimelineTreeView = class extends UI.VBox {
10 constructor() { 10 constructor() {
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after
242 this._searchableView.cancelSearch(); 242 this._searchableView.cancelSearch();
243 this._dataGrid.rootNode().removeChildren(); 243 this._dataGrid.rootNode().removeChildren();
244 if (!this._model) { 244 if (!this._model) {
245 this._updateDetailsForSelection(); 245 this._updateDetailsForSelection();
246 return; 246 return;
247 } 247 }
248 this._root = this._buildTree(); 248 this._root = this._buildTree();
249 var children = this._root.children(); 249 var children = this._root.children();
250 var maxSelfTime = 0; 250 var maxSelfTime = 0;
251 var maxTotalTime = 0; 251 var maxTotalTime = 0;
252 var totalUsedTime = this._root.totalTime - this._root.selfTime;
252 for (var child of children.values()) { 253 for (var child of children.values()) {
253 maxSelfTime = Math.max(maxSelfTime, child.selfTime); 254 maxSelfTime = Math.max(maxSelfTime, child.selfTime);
254 maxTotalTime = Math.max(maxTotalTime, child.totalTime); 255 maxTotalTime = Math.max(maxTotalTime, child.totalTime);
255 } 256 }
256 for (var child of children.values()) { 257 for (var child of children.values()) {
257 // Exclude the idle time off the total calculation. 258 // Exclude the idle time off the total calculation.
258 var gridNode = 259 var gridNode = new Timeline.TimelineTreeView.TreeGridNode(child, totalUsed Time, maxSelfTime, maxTotalTime, this);
259 new Timeline.TimelineTreeView.TreeGridNode(child, this._root.totalTime , maxSelfTime, maxTotalTime, this);
260 this._dataGrid.insertChild(gridNode); 260 this._dataGrid.insertChild(gridNode);
261 } 261 }
262 this._sortingChanged(); 262 this._sortingChanged();
263 this._updateDetailsForSelection(); 263 this._updateDetailsForSelection();
264 } 264 }
265 265
266 /** 266 /**
267 * @return {!TimelineModel.TimelineProfileTree.Node} 267 * @return {!TimelineModel.TimelineProfileTree.Node}
268 */ 268 */
269 _buildTree() { 269 _buildTree() {
(...skipping 567 matching lines...) Expand 10 before | Expand all | Expand 10 after
837 return groupByDomain.bind(null, true); 837 return groupByDomain.bind(null, true);
838 case Timeline.AggregatedTimelineTreeView.GroupBy.URL: 838 case Timeline.AggregatedTimelineTreeView.GroupBy.URL:
839 return groupByURL; 839 return groupByURL;
840 case Timeline.AggregatedTimelineTreeView.GroupBy.Frame: 840 case Timeline.AggregatedTimelineTreeView.GroupBy.Frame:
841 return event => TimelineModel.TimelineData.forEvent(event).frameId; 841 return event => TimelineModel.TimelineData.forEvent(event).frameId;
842 default: 842 default:
843 console.assert(false, `Unexpected aggregation setting: ${groupBy}`); 843 console.assert(false, `Unexpected aggregation setting: ${groupBy}`);
844 return null; 844 return null;
845 } 845 }
846 } 846 }
847
847 /** 848 /**
848 * @override 849 * @override
849 * @param {!UI.ContextMenu} contextMenu 850 * @param {!UI.ContextMenu} contextMenu
850 * @param {!TimelineModel.TimelineProfileTree.Node} node 851 * @param {!TimelineModel.TimelineProfileTree.Node} node
851 */ 852 */
852 _appendContextMenuItems(contextMenu, node) { 853 _appendContextMenuItems(contextMenu, node) {
853 if (this._groupBySetting.get() !== Timeline.AggregatedTimelineTreeView.Group By.Frame) 854 if (this._groupBySetting.get() !== Timeline.AggregatedTimelineTreeView.Group By.Frame)
854 return; 855 return;
855 if (!node.isGroupNode()) 856 if (!node.isGroupNode())
856 return; 857 return;
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
985 986
986 _onSelectionChanged() { 987 _onSelectionChanged() {
987 this.dispatchEventToListeners(Timeline.TimelineStackView.Events.SelectionCha nged); 988 this.dispatchEventToListeners(Timeline.TimelineStackView.Events.SelectionCha nged);
988 } 989 }
989 }; 990 };
990 991
991 /** @enum {symbol} */ 992 /** @enum {symbol} */
992 Timeline.TimelineStackView.Events = { 993 Timeline.TimelineStackView.Events = {
993 SelectionChanged: Symbol('SelectionChanged') 994 SelectionChanged: Symbol('SelectionChanged')
994 }; 995 };
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/devtools/front_end/timeline/timelinePanel.css » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698