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

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

Issue 320953002: Timeline: split frame model into trace-specific and record-specific parts (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebased and removed extra semicolon 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 f5f02e718cbfc6cd18fce41384fda54494e67193..d34f59c9c55fd8c9987386466b59290bc0a61035 100644
--- a/Source/devtools/front_end/timeline/TimelinePanel.js
+++ b/Source/devtools/front_end/timeline/TimelinePanel.js
@@ -249,16 +249,21 @@ WebInspector.TimelinePanel.prototype = {
},
/**
- * @return {!WebInspector.TimelineFrameModel}
+ * @return {!WebInspector.TimelineFrameModelBase}
*/
_frameModel: function()
{
- if (!this._lazyFrameModel) {
- this._lazyFrameModel = new WebInspector.TimelineFrameModel(this._model.target());
- this._lazyFrameModel.setMergeRecords(!WebInspector.experimentsSettings.timelineNoLiveUpdate.isEnabled() || !this._recordingInProgress);
- this._lazyFrameModel.addRecords(this._model.records());
- if (this._tracingModel)
- this._lazyFrameModel.addTraceEvents(this._tracingTimelineModel.inspectedTargetEvents(), this._tracingModel.sessionId() || "");
+ if (this._lazyFrameModel)
+ return this._lazyFrameModel;
+ if (this._tracingModel) {
+ var tracingFrameModel = new WebInspector.TracingTimelineFrameModel(this._model.target());
+ tracingFrameModel.addTraceEvents(this._tracingTimelineModel.inspectedTargetEvents(), this._tracingModel.sessionId() || "");
+ this._lazyFrameModel = tracingFrameModel;
+ } else {
+ var frameModel = new WebInspector.TimelineFrameModel(this._model.target());
+ frameModel.setMergeRecords(!WebInspector.experimentsSettings.timelineNoLiveUpdate.isEnabled() || !this._recordingInProgress);
+ frameModel.addRecords(this._model.records());
+ this._lazyFrameModel = frameModel;
}
return this._lazyFrameModel;
},
@@ -809,7 +814,7 @@ WebInspector.TimelinePanel.prototype = {
*/
_addRecord: function(record)
{
- if (this._lazyFrameModel)
+ if (this._lazyFrameModel && !this._tracingModel)
this._lazyFrameModel.addRecord(record);
for (var i = 0; i < this._currentViews.length; ++i)
this._currentViews[i].addRecord(record);
« no previous file with comments | « Source/devtools/front_end/timeline/TimelineFrameOverview.js ('k') | Source/devtools/front_end/timeline/TimelineView.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698