Chromium Code Reviews| 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 * @unrestricted | 5 * @unrestricted |
| 6 */ | 6 */ |
| 7 WebInspector.TimelineTreeView = class extends WebInspector.VBox { | 7 WebInspector.TimelineTreeView = class extends WebInspector.VBox { |
| 8 constructor() { | 8 constructor() { |
| 9 super(); | 9 super(); |
| 10 this.element.classList.add('timeline-tree-view'); | 10 this.element.classList.add('timeline-tree-view'); |
| (...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 315 if (columnId === 'activity') | 315 if (columnId === 'activity') |
| 316 return this._createNameCell(columnId); | 316 return this._createNameCell(columnId); |
| 317 return this._createValueCell(columnId) || super.createCell(columnId); | 317 return this._createValueCell(columnId) || super.createCell(columnId); |
| 318 } | 318 } |
| 319 | 319 |
| 320 /** | 320 /** |
| 321 * @param {string} columnId | 321 * @param {string} columnId |
| 322 * @return {!Element} | 322 * @return {!Element} |
| 323 */ | 323 */ |
| 324 _createNameCell(columnId) { | 324 _createNameCell(columnId) { |
| 325 var cell = this.createTD(columnId); | 325 const cell = this.createTD(columnId); |
| 326 var container = cell.createChild('div', 'name-container'); | 326 const container = cell.createChild('div', 'name-container'); |
| 327 var icon = container.createChild('div', 'activity-icon'); | 327 const icon = container.createChild('div', 'activity-icon'); |
| 328 var name = container.createChild('div', 'activity-name'); | 328 const name = container.createChild('div', 'activity-name'); |
| 329 var event = this._profileNode.event; | 329 const event = this._profileNode.event; |
| 330 if (this._profileNode.isGroupNode()) { | 330 if (this._profileNode.isGroupNode()) { |
| 331 var treeView = /** @type {!WebInspector.AggregatedTimelineTreeView} */ (th is._treeView); | 331 const treeView = /** @type {!WebInspector.AggregatedTimelineTreeView} */ ( this._treeView); |
| 332 var info = treeView._displayInfoForGroupNode(this._profileNode); | 332 const info = treeView._displayInfoForGroupNode(this._profileNode); |
| 333 name.textContent = info.name; | 333 name.textContent = info.name; |
| 334 icon.style.backgroundColor = info.color; | 334 icon.style.backgroundColor = info.color; |
| 335 } else if (event) { | 335 } else if (event) { |
| 336 var data = event.args['data']; | 336 const data = event.args['data']; |
| 337 var deoptReason = data && data['deoptReason']; | 337 const deoptReason = data && data['deoptReason']; |
| 338 if (deoptReason) | 338 if (deoptReason) { |
| 339 container.createChild('div', 'activity-warning').title = | 339 container.createChild('div', 'activity-warning').title = |
| 340 WebInspector.UIString('Not optimized: %s', deoptReason); | 340 WebInspector.UIString('Not optimized: %s', deoptReason); |
| 341 name.textContent = event.name === WebInspector.TimelineModel.RecordType.JS Frame ? | 341 } |
| 342 WebInspector.beautifyFunctionName(event.args['data']['functionName']) : | 342 name.textContent = event.name === WebInspector.TimelineModel.RecordType.JS Frame |
|
caseq
2016/11/11 21:45:29
Should this logic just be a part of eventTitle()?
alph
2016/11/11 22:29:12
Done.
| |
| 343 WebInspector.TimelineUIUtils.eventTitle(event); | 343 ? WebInspector.TimelineUIUtils.frameDisplayName(data) |
| 344 var link = this._treeView._linkifyLocation(event); | 344 : WebInspector.TimelineUIUtils.eventTitle(event); |
| 345 const link = this._treeView._linkifyLocation(event); | |
| 345 if (link) | 346 if (link) |
| 346 container.createChild('div', 'activity-link').appendChild(link); | 347 container.createChild('div', 'activity-link').appendChild(link); |
| 347 icon.style.backgroundColor = WebInspector.TimelineUIUtils.eventColor(event ); | 348 icon.style.backgroundColor = WebInspector.TimelineUIUtils.eventColor(event ); |
| 348 } | 349 } |
| 349 return cell; | 350 return cell; |
| 350 } | 351 } |
| 351 | 352 |
| 352 /** | 353 /** |
| 353 * @param {string} columnId | 354 * @param {string} columnId |
| 354 * @return {?Element} | 355 * @return {?Element} |
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 538 * @param {string} name | 539 * @param {string} name |
| 539 * @param {string} id | 540 * @param {string} id |
| 540 * @this {WebInspector.TimelineTreeView} | 541 * @this {WebInspector.TimelineTreeView} |
| 541 */ | 542 */ |
| 542 function addGroupingOption(name, id) { | 543 function addGroupingOption(name, id) { |
| 543 var option = this._groupByCombobox.createOption(name, '', id); | 544 var option = this._groupByCombobox.createOption(name, '', id); |
| 544 this._groupByCombobox.addOption(option); | 545 this._groupByCombobox.addOption(option); |
| 545 if (id === this._groupBySetting.get()) | 546 if (id === this._groupBySetting.get()) |
| 546 this._groupByCombobox.select(option); | 547 this._groupByCombobox.select(option); |
| 547 } | 548 } |
| 548 addGroupingOption.call(this, WebInspector.UIString('No Grouping'), WebInspec tor.AggregatedTimelineTreeView.GroupBy.None); | 549 const groupBy = WebInspector.AggregatedTimelineTreeView.GroupBy; |
| 549 addGroupingOption.call( | 550 addGroupingOption.call(this, WebInspector.UIString('No Grouping'), groupBy.N one); |
| 550 this, WebInspector.UIString('Group by Activity'), WebInspector.Aggregate dTimelineTreeView.GroupBy.EventName); | 551 addGroupingOption.call(this, WebInspector.UIString('Group by Activity'), gro upBy.EventName); |
| 551 addGroupingOption.call( | 552 addGroupingOption.call(this, WebInspector.UIString('Group by Category'), gro upBy.Category); |
| 552 this, WebInspector.UIString('Group by Category'), WebInspector.Aggregate dTimelineTreeView.GroupBy.Category); | 553 addGroupingOption.call(this, WebInspector.UIString('Group by Domain'), group By.Domain); |
| 553 addGroupingOption.call( | 554 addGroupingOption.call(this, WebInspector.UIString('Group by Subdomain'), gr oupBy.Subdomain); |
| 554 this, WebInspector.UIString('Group by Domain'), WebInspector.AggregatedT imelineTreeView.GroupBy.Domain); | 555 addGroupingOption.call(this, WebInspector.UIString('Group by URL'), groupBy. URL); |
| 555 addGroupingOption.call( | 556 addGroupingOption.call(this, WebInspector.UIString('Group by Frame'), groupB y.Frame); |
| 556 this, WebInspector.UIString('Group by Subdomain'), WebInspector.Aggregat edTimelineTreeView.GroupBy.Subdomain); | |
| 557 addGroupingOption.call(this, WebInspector.UIString('Group by URL'), WebInspe ctor.AggregatedTimelineTreeView.GroupBy.URL); | |
| 558 addGroupingOption.call(this, WebInspector.UIString('Group by Frame'), WebIns pector.AggregatedTimelineTreeView.GroupBy.Frame); | |
| 559 panelToolbar.appendToolbarItem(this._groupByCombobox); | 557 panelToolbar.appendToolbarItem(this._groupByCombobox); |
| 560 } | 558 } |
| 561 | 559 |
| 562 /** | 560 /** |
| 563 * @param {!WebInspector.TimelineProfileTree.Node} treeNode | 561 * @param {!WebInspector.TimelineProfileTree.Node} treeNode |
| 564 * @return {!Array<!WebInspector.TimelineProfileTree.Node>} | 562 * @return {!Array<!WebInspector.TimelineProfileTree.Node>} |
| 565 */ | 563 */ |
| 566 _buildHeaviestStack(treeNode) { | 564 _buildHeaviestStack(treeNode) { |
| 567 console.assert(!!treeNode.parent, 'Attempt to build stack for tree root'); | 565 console.assert(!!treeNode.parent, 'Attempt to build stack for tree root'); |
| 568 var result = []; | 566 var result = []; |
| (...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 924 | 922 |
| 925 _onSelectionChanged() { | 923 _onSelectionChanged() { |
| 926 this.dispatchEventToListeners(WebInspector.TimelineStackView.Events.Selectio nChanged); | 924 this.dispatchEventToListeners(WebInspector.TimelineStackView.Events.Selectio nChanged); |
| 927 } | 925 } |
| 928 }; | 926 }; |
| 929 | 927 |
| 930 /** @enum {symbol} */ | 928 /** @enum {symbol} */ |
| 931 WebInspector.TimelineStackView.Events = { | 929 WebInspector.TimelineStackView.Events = { |
| 932 SelectionChanged: Symbol('SelectionChanged') | 930 SelectionChanged: Symbol('SelectionChanged') |
| 933 }; | 931 }; |
| OLD | NEW |