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

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

Issue 339493005: Move more methods into implementation specific timeline UI utils (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 6 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2014 Google Inc. All rights reserved. 2 * Copyright (C) 2014 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 * @param {number} entryIndex 82 * @param {number} entryIndex
83 * @return {?string} 83 * @return {?string}
84 */ 84 */
85 entryTitle: function(entryIndex) 85 entryTitle: function(entryIndex)
86 { 86 {
87 var record = this._records[entryIndex]; 87 var record = this._records[entryIndex];
88 if (record === this._cpuThreadRecord) 88 if (record === this._cpuThreadRecord)
89 return WebInspector.UIString("CPU"); 89 return WebInspector.UIString("CPU");
90 else if (record === this._gpuThreadRecord) 90 else if (record === this._gpuThreadRecord)
91 return WebInspector.UIString("GPU"); 91 return WebInspector.UIString("GPU");
92 var details = WebInspector.TimelineUIUtils.buildDetailsNode(record, this ._linkifier, this._model.loadedFromFile()); 92 var details = WebInspector.TimelineUIUtilsImpl.buildDetailsNode(record, this._linkifier, this._model.loadedFromFile());
93 return details ? WebInspector.UIString("%s (%s)", record.title(), detail s.textContent) : record.title(); 93 return details ? WebInspector.UIString("%s (%s)", record.title(), detail s.textContent) : record.title();
94 }, 94 },
95 95
96 /** 96 /**
97 * @param {number} startTime 97 * @param {number} startTime
98 * @param {number} endTime 98 * @param {number} endTime
99 * @return {?Array.<number>} 99 * @return {?Array.<number>}
100 */ 100 */
101 dividerOffsets: function(startTime, endTime) 101 dividerOffsets: function(startTime, endTime)
102 { 102 {
(...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after
492 }, 492 },
493 493
494 /** 494 /**
495 * @param {number} entryIndex 495 * @param {number} entryIndex
496 * @return {?string} 496 * @return {?string}
497 */ 497 */
498 entryTitle: function(entryIndex) 498 entryTitle: function(entryIndex)
499 { 499 {
500 var event = this._entryEvents[entryIndex]; 500 var event = this._entryEvents[entryIndex];
501 if (event) { 501 if (event) {
502 var name = WebInspector.TimelineUIUtils.styleForTimelineEvent(event. name).title; 502 var name = WebInspector.TracingTimelineUIUtils.styleForTraceEvent(ev ent.name).title;
503 // TODO(yurys): support event dividers 503 // TODO(yurys): support event dividers
504 var details = WebInspector.TracingTimelineUIUtils.buildDetailsNodeFo rTraceEvent(event, this._linkifier, false, this._target); 504 var details = WebInspector.TracingTimelineUIUtils.buildDetailsNodeFo rTraceEvent(event, this._linkifier, false, this._target);
505 return details ? WebInspector.UIString("%s (%s)", name, details.text Content) : name; 505 return details ? WebInspector.UIString("%s (%s)", name, details.text Content) : name;
506 } 506 }
507 var title = this._entryIndexToTitle[entryIndex]; 507 var title = this._entryIndexToTitle[entryIndex];
508 if (!title) { 508 if (!title) {
509 title = WebInspector.UIString("Unexpected entryIndex %d", entryIndex ); 509 title = WebInspector.UIString("Unexpected entryIndex %d", entryIndex );
510 console.error(title); 510 console.error(title);
511 } 511 }
512 return title; 512 return title;
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
614 614
615 /** 615 /**
616 * @param {number} entryIndex 616 * @param {number} entryIndex
617 * @return {string} 617 * @return {string}
618 */ 618 */
619 entryColor: function(entryIndex) 619 entryColor: function(entryIndex)
620 { 620 {
621 var event = this._entryEvents[entryIndex]; 621 var event = this._entryEvents[entryIndex];
622 if (!event) 622 if (!event)
623 return "#555"; 623 return "#555";
624 var style = WebInspector.TimelineUIUtils.styleForTimelineEvent(event.nam e); 624 var style = WebInspector.TracingTimelineUIUtils.styleForTraceEvent(event .name);
625 return style.category.fillColorStop1; 625 return style.category.fillColorStop1;
626 }, 626 },
627 627
628 /** 628 /**
629 * @param {number} entryIndex 629 * @param {number} entryIndex
630 * @param {!CanvasRenderingContext2D} context 630 * @param {!CanvasRenderingContext2D} context
631 * @param {?string} text 631 * @param {?string} text
632 * @param {number} barX 632 * @param {number} barX
633 * @param {number} barY 633 * @param {number} barY
634 * @param {number} barWidth 634 * @param {number} barWidth
(...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after
970 * @param {number} entryIndex 970 * @param {number} entryIndex
971 * @return {?WebInspector.TimelineSelection} 971 * @return {?WebInspector.TimelineSelection}
972 */ 972 */
973 createSelection: function(entryIndex) { }, 973 createSelection: function(entryIndex) { },
974 /** 974 /**
975 * @param {?WebInspector.TimelineSelection} selection 975 * @param {?WebInspector.TimelineSelection} selection
976 * @return {number} 976 * @return {number}
977 */ 977 */
978 entryIndexForSelection: function(selection) { } 978 entryIndexForSelection: function(selection) { }
979 } 979 }
OLDNEW
« no previous file with comments | « LayoutTests/inspector/timeline/timeline-script-id.html ('k') | Source/devtools/front_end/timeline/TimelinePanel.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698