| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |