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

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

Issue 397313003: DevTools: Remove target function from TimelineModel (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase once more Created 6 years, 5 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 15 matching lines...) Expand all
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 */ 29 */
30 30
31 /** 31 /**
32 * @constructor 32 * @constructor
33 * @implements {WebInspector.FlameChartDataProvider} 33 * @implements {WebInspector.FlameChartDataProvider}
34 * @param {!WebInspector.TracingTimelineModel} model 34 * @param {!WebInspector.TracingTimelineModel} model
35 * @param {!WebInspector.TimelineFrameModelBase} frameModel 35 * @param {!WebInspector.TimelineFrameModelBase} frameModel
36 * @param {!WebInspector.Target} target
37 */ 36 */
38 WebInspector.TimelineFlameChartDataProvider = function(model, frameModel, target ) 37 WebInspector.TimelineFlameChartDataProvider = function(model, frameModel)
39 { 38 {
40 WebInspector.FlameChartDataProvider.call(this); 39 WebInspector.FlameChartDataProvider.call(this);
41 this._model = model; 40 this._model = model;
42 this._frameModel = frameModel; 41 this._frameModel = frameModel;
43 this._target = target;
44 this._font = "12px " + WebInspector.fontFamily(); 42 this._font = "12px " + WebInspector.fontFamily();
45 this._linkifier = new WebInspector.Linkifier(); 43 this._linkifier = new WebInspector.Linkifier();
46 this._entryIndexToTitle = {}; 44 this._entryIndexToTitle = {};
47 this._filters = []; 45 this._filters = [];
48 this.addFilter(WebInspector.TracingTimelineUIUtils.hiddenEventsFilter()); 46 this.addFilter(WebInspector.TracingTimelineUIUtils.hiddenEventsFilter());
49 this.addFilter(new WebInspector.TracingTimelineModel.ExclusiveEventNameFilte r([WebInspector.TracingTimelineModel.RecordType.Program])); 47 this.addFilter(new WebInspector.TracingTimelineModel.ExclusiveEventNameFilte r([WebInspector.TracingTimelineModel.RecordType.Program]));
50 } 48 }
51 49
52 WebInspector.TimelineFlameChartDataProvider.InstantEventVisibleDurationMs = 0.01 ; 50 WebInspector.TimelineFlameChartDataProvider.InstantEventVisibleDurationMs = 0.01 ;
53 51
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 /** 86 /**
89 * @param {number} entryIndex 87 * @param {number} entryIndex
90 * @return {?string} 88 * @return {?string}
91 */ 89 */
92 entryTitle: function(entryIndex) 90 entryTitle: function(entryIndex)
93 { 91 {
94 var event = this._entryEvents[entryIndex]; 92 var event = this._entryEvents[entryIndex];
95 if (event) { 93 if (event) {
96 var name = WebInspector.TracingTimelineUIUtils.styleForTraceEvent(ev ent.name).title; 94 var name = WebInspector.TracingTimelineUIUtils.styleForTraceEvent(ev ent.name).title;
97 // TODO(yurys): support event dividers 95 // TODO(yurys): support event dividers
98 var details = WebInspector.TracingTimelineUIUtils.buildDetailsNodeFo rTraceEvent(event, this._linkifier, false, this._target); 96 var details = WebInspector.TracingTimelineUIUtils.buildDetailsNodeFo rTraceEvent(event, this._linkifier);
99 if (event.name === WebInspector.TracingTimelineModel.RecordType.JSFr ame && details) 97 if (event.name === WebInspector.TracingTimelineModel.RecordType.JSFr ame && details)
100 return details.textContent; 98 return details.textContent;
101 return details ? WebInspector.UIString("%s (%s)", name, details.text Content) : name; 99 return details ? WebInspector.UIString("%s (%s)", name, details.text Content) : name;
102 } 100 }
103 var title = this._entryIndexToTitle[entryIndex]; 101 var title = this._entryIndexToTitle[entryIndex];
104 if (!title) { 102 if (!title) {
105 title = WebInspector.UIString("Unexpected entryIndex %d", entryIndex ); 103 title = WebInspector.UIString("Unexpected entryIndex %d", entryIndex );
106 console.error(title); 104 console.error(title);
107 } 105 }
108 return title; 106 return title;
(...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after
483 * @param {!WebInspector.TracingTimelineModel} tracingModel 481 * @param {!WebInspector.TracingTimelineModel} tracingModel
484 * @param {!WebInspector.TimelineFrameModelBase} frameModel 482 * @param {!WebInspector.TimelineFrameModelBase} frameModel
485 */ 483 */
486 WebInspector.TimelineFlameChart = function(delegate, tracingModel, frameModel) 484 WebInspector.TimelineFlameChart = function(delegate, tracingModel, frameModel)
487 { 485 {
488 WebInspector.VBox.call(this); 486 WebInspector.VBox.call(this);
489 this.element.classList.add("timeline-flamechart"); 487 this.element.classList.add("timeline-flamechart");
490 this.registerRequiredCSS("flameChart.css"); 488 this.registerRequiredCSS("flameChart.css");
491 this._delegate = delegate; 489 this._delegate = delegate;
492 this._model = tracingModel; 490 this._model = tracingModel;
493 this._dataProvider = new WebInspector.TimelineFlameChartDataProvider(tracing Model, frameModel, tracingModel.target()) 491 this._dataProvider = new WebInspector.TimelineFlameChartDataProvider(tracing Model, frameModel)
494 this._mainView = new WebInspector.FlameChart(this._dataProvider, this, true) ; 492 this._mainView = new WebInspector.FlameChart(this._dataProvider, this, true) ;
495 this._mainView.show(this.element); 493 this._mainView.show(this.element);
496 this._model.addEventListener(WebInspector.TimelineModel.Events.RecordingStar ted, this._onRecordingStarted, this); 494 this._model.addEventListener(WebInspector.TimelineModel.Events.RecordingStar ted, this._onRecordingStarted, this);
497 this._mainView.addEventListener(WebInspector.FlameChart.Events.EntrySelected , this._onEntrySelected, this); 495 this._mainView.addEventListener(WebInspector.FlameChart.Events.EntrySelected , this._onEntrySelected, this);
498 } 496 }
499 497
500 WebInspector.TimelineFlameChart.prototype = { 498 WebInspector.TimelineFlameChart.prototype = {
501 dispose: function() 499 dispose: function()
502 { 500 {
503 this._model.removeEventListener(WebInspector.TimelineModel.Events.Record ingStarted, this._onRecordingStarted, this); 501 this._model.removeEventListener(WebInspector.TimelineModel.Events.Record ingStarted, this._onRecordingStarted, this);
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
627 /** 625 /**
628 * @constructor 626 * @constructor
629 * @param {!WebInspector.TimelineSelection} selection 627 * @param {!WebInspector.TimelineSelection} selection
630 * @param {number} entryIndex 628 * @param {number} entryIndex
631 */ 629 */
632 WebInspector.TimelineFlameChart.Selection = function(selection, entryIndex) 630 WebInspector.TimelineFlameChart.Selection = function(selection, entryIndex)
633 { 631 {
634 this.timelineSelection = selection; 632 this.timelineSelection = selection;
635 this.entryIndex = entryIndex; 633 this.entryIndex = entryIndex;
636 } 634 }
OLDNEW
« no previous file with comments | « Source/devtools/front_end/profiler/ProfilesPanel.js ('k') | Source/devtools/front_end/timeline/TimelineModel.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698