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

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

Issue 344443007: Encapsulate implementation-specific timeline record handling in TimelineUIUtils (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) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * Copyright (C) 2012 Intel Inc. All rights reserved. 3 * Copyright (C) 2012 Intel Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 29 matching lines...) Expand all
40 importScript("TimelinePresentationModel.js"); 40 importScript("TimelinePresentationModel.js");
41 importScript("TracingTimelineModel.js"); 41 importScript("TracingTimelineModel.js");
42 importScript("TimelineFrameModel.js"); 42 importScript("TimelineFrameModel.js");
43 importScript("TimelineEventOverview.js"); 43 importScript("TimelineEventOverview.js");
44 importScript("TimelineFrameOverview.js"); 44 importScript("TimelineFrameOverview.js");
45 importScript("TimelineMemoryOverview.js"); 45 importScript("TimelineMemoryOverview.js");
46 importScript("TimelinePowerGraph.js"); 46 importScript("TimelinePowerGraph.js");
47 importScript("TimelinePowerOverview.js"); 47 importScript("TimelinePowerOverview.js");
48 importScript("TimelineFlameChart.js"); 48 importScript("TimelineFlameChart.js");
49 importScript("TimelineUIUtils.js"); 49 importScript("TimelineUIUtils.js");
50 importScript("TimelineUIUtilsImpl.js");
50 importScript("TimelineView.js"); 51 importScript("TimelineView.js");
51 importScript("TimelineTracingView.js"); 52 importScript("TimelineTracingView.js");
52 importScript("TimelineLayersView.js"); 53 importScript("TimelineLayersView.js");
53 importScript("TracingModel.js"); 54 importScript("TracingModel.js");
54 importScript("TracingTimelineUIUtils.js"); 55 importScript("TracingTimelineUIUtils.js");
55 importScript("TransformController.js"); 56 importScript("TransformController.js");
56 57
57 /** 58 /**
58 * @constructor 59 * @constructor
59 * @extends {WebInspector.Panel} 60 * @extends {WebInspector.Panel}
(...skipping 13 matching lines...) Expand all
73 this._windowEndTime = Infinity; 74 this._windowEndTime = Infinity;
74 75
75 // Create model. 76 // Create model.
76 if (WebInspector.experimentsSettings.timelineTracingMode.isEnabled() || 77 if (WebInspector.experimentsSettings.timelineTracingMode.isEnabled() ||
77 WebInspector.experimentsSettings.timelineOnTraceEvents.isEnabled()) { 78 WebInspector.experimentsSettings.timelineOnTraceEvents.isEnabled()) {
78 this._tracingModel = new WebInspector.TracingModel(WebInspector.targetMa nager.activeTarget()); 79 this._tracingModel = new WebInspector.TracingModel(WebInspector.targetMa nager.activeTarget());
79 this._tracingModel.addEventListener(WebInspector.TracingModel.Events.Buf ferUsage, this._onTracingBufferUsage, this); 80 this._tracingModel.addEventListener(WebInspector.TracingModel.Events.Buf ferUsage, this._onTracingBufferUsage, this);
80 81
81 this._tracingTimelineModel = new WebInspector.TracingTimelineModel(this. _tracingModel); 82 this._tracingTimelineModel = new WebInspector.TracingTimelineModel(this. _tracingModel);
82 this._model = this._tracingTimelineModel; 83 this._model = this._tracingTimelineModel;
84 this._uiUtils = new WebInspector.TracingTimelineUIUtils();
83 } else { 85 } else {
84 this._model = new WebInspector.TimelineModelImpl(WebInspector.timelineMa nager); 86 this._model = new WebInspector.TimelineModelImpl(WebInspector.timelineMa nager);
87 this._uiUtils = new WebInspector.TimelineUIUtilsImpl();
85 } 88 }
86 89
87 this._model.addEventListener(WebInspector.TimelineModel.Events.RecordingStar ted, this._onRecordingStarted, this); 90 this._model.addEventListener(WebInspector.TimelineModel.Events.RecordingStar ted, this._onRecordingStarted, this);
88 this._model.addEventListener(WebInspector.TimelineModel.Events.RecordingStop ped, this._onRecordingStopped, this); 91 this._model.addEventListener(WebInspector.TimelineModel.Events.RecordingStop ped, this._onRecordingStopped, this);
89 this._model.addEventListener(WebInspector.TimelineModel.Events.RecordsCleare d, this._onRecordsCleared, this); 92 this._model.addEventListener(WebInspector.TimelineModel.Events.RecordsCleare d, this._onRecordsCleared, this);
90 this._model.addEventListener(WebInspector.TimelineModel.Events.RecordingProg ress, this._onRecordingProgress, this); 93 this._model.addEventListener(WebInspector.TimelineModel.Events.RecordingProg ress, this._onRecordingProgress, this);
91 this._model.addEventListener(WebInspector.TimelineModel.Events.RecordFilterC hanged, this._refreshViews, this); 94 this._model.addEventListener(WebInspector.TimelineModel.Events.RecordFilterC hanged, this._refreshViews, this);
92 this._model.addEventListener(WebInspector.TimelineModel.Events.RecordAdded, this._onRecordAdded, this); 95 this._model.addEventListener(WebInspector.TimelineModel.Events.RecordAdded, this._onRecordAdded, this);
93 96
94 this._model.target().profilingLock.addEventListener(WebInspector.Lock.Events .StateChanged, this._onProfilingStateChanged, this); 97 this._model.target().profilingLock.addEventListener(WebInspector.Lock.Events .StateChanged, this._onProfilingStateChanged, this);
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
266 this._lazyFrameModel = frameModel; 269 this._lazyFrameModel = frameModel;
267 } 270 }
268 return this._lazyFrameModel; 271 return this._lazyFrameModel;
269 }, 272 },
270 273
271 /** 274 /**
272 * @return {!WebInspector.TimelineView} 275 * @return {!WebInspector.TimelineView}
273 */ 276 */
274 _timelineView: function() 277 _timelineView: function()
275 { 278 {
276 if (!this._lazyTimelineView) { 279 if (!this._lazyTimelineView)
277 var coalescableRecordTypes = this._tracingTimelineModel ? WebInspect or.TracingTimelineUIUtils.coalescableRecordTypes : WebInspector.TimelineUIUtils. coalescableRecordTypes; 280 this._lazyTimelineView = new WebInspector.TimelineView(this, this._m odel, this._uiUtils);
278 this._lazyTimelineView = new WebInspector.TimelineView(this, this._m odel, coalescableRecordTypes);
279 }
280 return this._lazyTimelineView; 281 return this._lazyTimelineView;
281 }, 282 },
282 283
283 /** 284 /**
284 * @return {!WebInspector.View} 285 * @return {!WebInspector.View}
285 */ 286 */
286 _layersView: function() 287 _layersView: function()
287 { 288 {
288 if (this._lazyLayersView) 289 if (this._lazyLayersView)
289 return this._lazyLayersView; 290 return this._lazyLayersView;
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after
614 { 615 {
615 this._stackView.detach(); 616 this._stackView.detach();
616 617
617 var isFrameMode = this._overviewModeSetting.get() === WebInspector.Timel inePanel.OverviewMode.Frames; 618 var isFrameMode = this._overviewModeSetting.get() === WebInspector.Timel inePanel.OverviewMode.Frames;
618 this._removeAllModeViews(); 619 this._removeAllModeViews();
619 this._overviewControls = []; 620 this._overviewControls = [];
620 621
621 if (isFrameMode) 622 if (isFrameMode)
622 this._overviewControls.push(new WebInspector.TimelineFrameOverview(t his._model, this._frameModel())); 623 this._overviewControls.push(new WebInspector.TimelineFrameOverview(t his._model, this._frameModel()));
623 else 624 else
624 this._overviewControls.push(new WebInspector.TimelineEventOverview(t his._model)); 625 this._overviewControls.push(new WebInspector.TimelineEventOverview(t his._model, this._uiUtils));
625 626
626 if (WebInspector.experimentsSettings.timelineFlameChart.isEnabled() && t his._flameChartEnabledSetting.get()) { 627 if (WebInspector.experimentsSettings.timelineFlameChart.isEnabled() && t his._flameChartEnabledSetting.get()) {
627 var tracingTimelineModel = WebInspector.experimentsSettings.timeline OnTraceEvents.isEnabled() ? this._tracingTimelineModel : null; 628 var tracingTimelineModel = WebInspector.experimentsSettings.timeline OnTraceEvents.isEnabled() ? this._tracingTimelineModel : null;
628 this._addModeView(new WebInspector.TimelineFlameChart(this, this._mo del, tracingTimelineModel, this._frameModel())); 629 this._addModeView(new WebInspector.TimelineFlameChart(this, this._mo del, tracingTimelineModel, this._frameModel()));
629 } else { 630 } else {
630 this._addModeView(this._timelineView()); 631 this._addModeView(this._timelineView());
631 } 632 }
632 633
633 if (this._captureMemorySetting.get()) { 634 if (this._captureMemorySetting.get()) {
634 if (!isFrameMode) // Frame mode skews time, don't render aux overvi ews. 635 if (!isFrameMode) // Frame mode skews time, don't render aux overvi ews.
635 this._overviewControls.push(new WebInspector.TimelineMemoryOverv iew(this._model)); 636 this._overviewControls.push(new WebInspector.TimelineMemoryOverv iew(this._model, this._uiUtils));
636 this._addModeView(new WebInspector.MemoryCountersGraph(this, this._m odel)); 637 this._addModeView(new WebInspector.MemoryCountersGraph(this, this._m odel, this._uiUtils));
637 } 638 }
638 639
639 if (this._capturePowerSetting && this._capturePowerSetting.get()) { 640 if (this._capturePowerSetting && this._capturePowerSetting.get()) {
640 if (!isFrameMode) // Frame mode skews time, don't render aux overvi ews. 641 if (!isFrameMode) // Frame mode skews time, don't render aux overvi ews.
641 this._overviewControls.push(new WebInspector.TimelinePowerOvervi ew(this._model)); 642 this._overviewControls.push(new WebInspector.TimelinePowerOvervi ew(this._model));
642 this._addModeView(new WebInspector.TimelinePowerGraph(this, this._mo del)); 643 this._addModeView(new WebInspector.TimelinePowerGraph(this, this._mo del));
643 } 644 }
644 645
645 if (this._captureTracingSetting && this._captureTracingSetting.get()) 646 if (this._captureTracingSetting && this._captureTracingSetting.get())
646 this._addModeView(new WebInspector.TimelineTracingView(this, this._t racingModel, this._model)); 647 this._addModeView(new WebInspector.TimelineTracingView(this, this._t racingModel, this._model));
(...skipping 809 matching lines...) Expand 10 before | Expand all | Expand 10 after
1456 * @param {!WebInspector.TimelineModel.Record} record 1457 * @param {!WebInspector.TimelineModel.Record} record
1457 * @return {boolean} 1458 * @return {boolean}
1458 */ 1459 */
1459 accept: function(record) 1460 accept: function(record)
1460 { 1461 {
1461 return !this._hiddenRecords[record.type()]; 1462 return !this._hiddenRecords[record.type()];
1462 }, 1463 },
1463 1464
1464 __proto__: WebInspector.TimelineModel.Filter.prototype 1465 __proto__: WebInspector.TimelineModel.Filter.prototype
1465 } 1466 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698