Index: third_party/WebKit/Source/devtools/front_end/timeline/TimelinePanel.js |
diff --git a/third_party/WebKit/Source/devtools/front_end/timeline/TimelinePanel.js b/third_party/WebKit/Source/devtools/front_end/timeline/TimelinePanel.js |
index 1c4b2dc0d7d0db8d227c8a4624239982470a6096..ae3eb290e70ef95df2c03a0df85cbaec02e2e705 100644 |
--- a/third_party/WebKit/Source/devtools/front_end/timeline/TimelinePanel.js |
+++ b/third_party/WebKit/Source/devtools/front_end/timeline/TimelinePanel.js |
@@ -58,8 +58,6 @@ WebInspector.TimelinePanel = function() |
if (Runtime.experiments.isEnabled("timelineLatencyInfo")) |
this._irModel = new WebInspector.TimelineIRModel(); |
- this._controller = new WebInspector.TimelineController(this, this._tracingModel); |
- |
if (Runtime.experiments.isEnabled("cpuThrottling")) |
this._cpuThrottlingManager = new WebInspector.CPUThrottlingManager(); |
@@ -609,11 +607,23 @@ WebInspector.TimelinePanel.prototype = { |
}, |
/** |
+ * @return {?WebInspector.TimelineController} |
+ */ |
+ _createController: function() |
caseq
2016/03/17 21:28:22
let's inline this.
alph
2016/03/17 21:36:50
Done.
|
+ { |
+ var mainTarget = WebInspector.targetManager.mainTarget(); |
+ return mainTarget ? new WebInspector.TimelineController(mainTarget, this, this._tracingModel) : null; |
+ }, |
+ |
+ /** |
* @param {boolean} userInitiated |
*/ |
_startRecording: function(userInitiated) |
{ |
console.assert(!this._statusPane, "Status pane is already opened."); |
+ this._controller = this._createController(); |
+ if (!this._controller) |
+ return; |
this._setState(WebInspector.TimelinePanel.State.StartPending); |
this._showRecordingStarted(); |
@@ -639,6 +649,7 @@ WebInspector.TimelinePanel.prototype = { |
this._setState(WebInspector.TimelinePanel.State.StopPending); |
this._autoRecordGeneration = null; |
this._controller.stopRecording(); |
+ this._controller = null; |
this._setUIControlsEnabled(true); |
}, |