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

Unified Diff: Source/devtools/front_end/timeline/TimelinePanel.js

Issue 310313003: Introduce TracingTimelineModel (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 side-by-side diff with in-line comments
Download patch
Index: Source/devtools/front_end/timeline/TimelinePanel.js
diff --git a/Source/devtools/front_end/timeline/TimelinePanel.js b/Source/devtools/front_end/timeline/TimelinePanel.js
index 8924b9ea85c660d28071d33e480fb34a3f7ce140..a4f8ce2f1194b95e8a893f76546180697882abdb 100644
--- a/Source/devtools/front_end/timeline/TimelinePanel.js
+++ b/Source/devtools/front_end/timeline/TimelinePanel.js
@@ -46,10 +46,10 @@ importScript("TimelinePowerOverview.js");
importScript("TimelineFlameChart.js");
importScript("TimelineUIUtils.js");
importScript("TimelineView.js");
-importScript("TimelineTraceEventBindings.js");
importScript("TimelineTracingView.js");
importScript("TimelineLayersView.js");
importScript("TracingModel.js");
+importScript("TracingTimelineModel.js");
importScript("TransformController.js");
/**
@@ -264,24 +264,12 @@ WebInspector.TimelinePanel.prototype = {
if (!this._lazyTracingModel) {
this._lazyTracingModel = new WebInspector.TracingModel(WebInspector.targetManager.activeTarget());
this._lazyTracingModel.addEventListener(WebInspector.TracingModel.Events.BufferUsage, this._onTracingBufferUsage, this);
+ this._tracingTimelineModel = new WebInspector.TracingTimelineModel(this._lazyTracingModel);
}
return this._lazyTracingModel;
},
/**
- * @return {!WebInspector.TimelineTraceEventBindings}
- */
- _traceEventBindings: function()
- {
- if (!this._lazyTraceEventBindings) {
- this._lazyTraceEventBindings = new WebInspector.TimelineTraceEventBindings();
- if (this._lazyTracingModel)
- this._lazyTraceEventBindings.setEvents(this._lazyTracingModel.inspectedTargetEvents());
- }
- return this._lazyTraceEventBindings;
- },
-
- /**
* @return {!WebInspector.TimelineView}
*/
_timelineView: function()
@@ -629,14 +617,13 @@ WebInspector.TimelinePanel.prototype = {
else
this._overviewControls.push(new WebInspector.TimelineEventOverview(this._model));
- var tracingModel = null;
- var traceEventBindings = null;
+ var tracingTimelineModel = null;
if (WebInspector.experimentsSettings.timelineOnTraceEvents.isEnabled()) {
- tracingModel = this._tracingModel();
- traceEventBindings = this._traceEventBindings();
+ this._tracingModel();
+ tracingTimelineModel = this._tracingTimelineModel;
}
if (WebInspector.experimentsSettings.timelineFlameChart.isEnabled() && this._flameChartEnabledSetting.get())
- this._addModeView(new WebInspector.TimelineFlameChart(this, this._model, tracingModel, traceEventBindings, this._frameModel()));
+ this._addModeView(new WebInspector.TimelineFlameChart(this, this._model, tracingTimelineModel, this._frameModel()));
else
this._addModeView(this._timelineView());
@@ -705,9 +692,9 @@ WebInspector.TimelinePanel.prototype = {
this._lazyFrameModel.addTraceEvents(this._lazyTracingModel.inspectedTargetEvents(), this._lazyTracingModel.sessionId());
this._overviewPane.update();
}
- if (this._lazyTraceEventBindings) {
- this._lazyTraceEventBindings.setEvents(this._lazyTracingModel.inspectedTargetEvents());
- this._model.didStopRecordingTraceEvents(this._lazyTraceEventBindings.mainThreadEvents());
+ if (WebInspector.experimentsSettings.timelineOnTraceEvents.isEnabled()) {
+ this._tracingTimelineModel.didStopRecordingTraceEvents();
+ this._model.didStopRecordingTraceEvents(this._tracingTimelineModel.mainThreadEvents());
}
this._refreshViews();
},
@@ -995,9 +982,8 @@ WebInspector.TimelinePanel.prototype = {
case WebInspector.TimelineSelection.Type.TraceEvent:
var event = /** @type {!WebInspector.TracingModel.Event} */ (this._selection.object());
var title = WebInspector.TimelineUIUtils.styleForTimelineEvent(event.name).title;
- var tracingModel = this._tracingModel();
- var bindings = this._traceEventBindings();
- WebInspector.TimelineUIUtils.buildTraceEventDetails(event, tracingModel, this._detailsLinkifier, this.showInDetails.bind(this, title), false, bindings, this._model.target());
+ var tracingModel = this._tracingTimelineModel;
+ WebInspector.TimelineUIUtils.buildTraceEventDetails(event, tracingModel, this._detailsLinkifier, this.showInDetails.bind(this, title), false, this._model.target());
break;
case WebInspector.TimelineSelection.Type.Frame:
var frame = /** @type {!WebInspector.TimelineFrame} */ (this._selection.object());
« no previous file with comments | « Source/devtools/front_end/timeline/TimelineModel.js ('k') | Source/devtools/front_end/timeline/TimelineTraceEventBindings.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698