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

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

Issue 2495903003: DevTools: Show friendly names for Parse/Compile RCS (Closed)
Patch Set: 4 landing Created 4 years, 1 month 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/TimelineUIUtils.js » ('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 * @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
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 = WebInspector.TimelineUIUtils.eventTitle(event);
343 WebInspector.TimelineUIUtils.eventTitle(event); 343 const link = this._treeView._linkifyLocation(event);
344 var link = this._treeView._linkifyLocation(event);
345 if (link) 344 if (link)
346 container.createChild('div', 'activity-link').appendChild(link); 345 container.createChild('div', 'activity-link').appendChild(link);
347 icon.style.backgroundColor = WebInspector.TimelineUIUtils.eventColor(event ); 346 icon.style.backgroundColor = WebInspector.TimelineUIUtils.eventColor(event );
348 } 347 }
349 return cell; 348 return cell;
350 } 349 }
351 350
352 /** 351 /**
353 * @param {string} columnId 352 * @param {string} columnId
354 * @return {?Element} 353 * @return {?Element}
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
538 * @param {string} name 537 * @param {string} name
539 * @param {string} id 538 * @param {string} id
540 * @this {WebInspector.TimelineTreeView} 539 * @this {WebInspector.TimelineTreeView}
541 */ 540 */
542 function addGroupingOption(name, id) { 541 function addGroupingOption(name, id) {
543 var option = this._groupByCombobox.createOption(name, '', id); 542 var option = this._groupByCombobox.createOption(name, '', id);
544 this._groupByCombobox.addOption(option); 543 this._groupByCombobox.addOption(option);
545 if (id === this._groupBySetting.get()) 544 if (id === this._groupBySetting.get())
546 this._groupByCombobox.select(option); 545 this._groupByCombobox.select(option);
547 } 546 }
548 addGroupingOption.call(this, WebInspector.UIString('No Grouping'), WebInspec tor.AggregatedTimelineTreeView.GroupBy.None); 547 const groupBy = WebInspector.AggregatedTimelineTreeView.GroupBy;
549 addGroupingOption.call( 548 addGroupingOption.call(this, WebInspector.UIString('No Grouping'), groupBy.N one);
550 this, WebInspector.UIString('Group by Activity'), WebInspector.Aggregate dTimelineTreeView.GroupBy.EventName); 549 addGroupingOption.call(this, WebInspector.UIString('Group by Activity'), gro upBy.EventName);
551 addGroupingOption.call( 550 addGroupingOption.call(this, WebInspector.UIString('Group by Category'), gro upBy.Category);
552 this, WebInspector.UIString('Group by Category'), WebInspector.Aggregate dTimelineTreeView.GroupBy.Category); 551 addGroupingOption.call(this, WebInspector.UIString('Group by Domain'), group By.Domain);
553 addGroupingOption.call( 552 addGroupingOption.call(this, WebInspector.UIString('Group by Subdomain'), gr oupBy.Subdomain);
554 this, WebInspector.UIString('Group by Domain'), WebInspector.AggregatedT imelineTreeView.GroupBy.Domain); 553 addGroupingOption.call(this, WebInspector.UIString('Group by URL'), groupBy. URL);
555 addGroupingOption.call( 554 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); 555 panelToolbar.appendToolbarItem(this._groupByCombobox);
560 } 556 }
561 557
562 /** 558 /**
563 * @param {!WebInspector.TimelineProfileTree.Node} treeNode 559 * @param {!WebInspector.TimelineProfileTree.Node} treeNode
564 * @return {!Array<!WebInspector.TimelineProfileTree.Node>} 560 * @return {!Array<!WebInspector.TimelineProfileTree.Node>}
565 */ 561 */
566 _buildHeaviestStack(treeNode) { 562 _buildHeaviestStack(treeNode) {
567 console.assert(!!treeNode.parent, 'Attempt to build stack for tree root'); 563 console.assert(!!treeNode.parent, 'Attempt to build stack for tree root');
568 var result = []; 564 var result = [];
(...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after
924 920
925 _onSelectionChanged() { 921 _onSelectionChanged() {
926 this.dispatchEventToListeners(WebInspector.TimelineStackView.Events.Selectio nChanged); 922 this.dispatchEventToListeners(WebInspector.TimelineStackView.Events.Selectio nChanged);
927 } 923 }
928 }; 924 };
929 925
930 /** @enum {symbol} */ 926 /** @enum {symbol} */
931 WebInspector.TimelineStackView.Events = { 927 WebInspector.TimelineStackView.Events = {
932 SelectionChanged: Symbol('SelectionChanged') 928 SelectionChanged: Symbol('SelectionChanged')
933 }; 929 };
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/devtools/front_end/timeline/TimelineUIUtils.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698