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

Unified Diff: Source/devtools/front_end/ScreencastView.js

Issue 408853003: DevTools: Remove calls of WebInspector.timelineManager and WebInspector.cpuProfilerModel from Scree… (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/devtools/front_end/ScreencastView.js
diff --git a/Source/devtools/front_end/ScreencastView.js b/Source/devtools/front_end/ScreencastView.js
index c13ffe96dc7bcd5a10bef1d22cd38fad76a8e19d..58b176513591fee54e937b20b97400c286568d0d 100644
--- a/Source/devtools/front_end/ScreencastView.js
+++ b/Source/devtools/front_end/ScreencastView.js
@@ -94,13 +94,13 @@ WebInspector.ScreencastView.prototype = {
WebInspector.resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel.EventTypes.ScreencastFrame, this._screencastFrame, this);
WebInspector.resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel.EventTypes.ScreencastVisibilityChanged, this._screencastVisibilityChanged, this);
- WebInspector.timelineManager.addEventListener(WebInspector.TimelineManager.EventTypes.TimelineStarted, this._onTimeline.bind(this, true), this);
- WebInspector.timelineManager.addEventListener(WebInspector.TimelineManager.EventTypes.TimelineStopped, this._onTimeline.bind(this, false), this);
- this._timelineActive = WebInspector.timelineManager.isStarted();
+ WebInspector.targetManager.addModelListener(WebInspector.TimelineManager, WebInspector.TimelineManager.EventTypes.TimelineStarted, this._onTimeline.bind(this), this);
+ WebInspector.targetManager.addModelListener(WebInspector.TimelineManager, WebInspector.TimelineManager.EventTypes.TimelineStopped, this._onTimeline.bind(this), this);
+ this._timelineActive = this._isTimelineActive();
- WebInspector.cpuProfilerModel.addEventListener(WebInspector.CPUProfilerModel.EventTypes.ProfileStarted, this._onProfiler.bind(this, true), this);
- WebInspector.cpuProfilerModel.addEventListener(WebInspector.CPUProfilerModel.EventTypes.ProfileStopped, this._onProfiler.bind(this, false), this);
- this._profilerActive = WebInspector.cpuProfilerModel.isRecordingProfile();
+ WebInspector.targetManager.addModelListener(WebInspector.CPUProfilerModel, WebInspector.CPUProfilerModel.EventTypes.ProfileStarted, this._onProfiler.bind(this), this);
+ WebInspector.targetManager.addModelListener(WebInspector.CPUProfilerModel, WebInspector.CPUProfilerModel.EventTypes.ProfileStopped, this._onProfiler.bind(this), this);
+ this._profilerActive = this._isProfilerActive();
this._updateGlasspane();
},
@@ -188,13 +188,9 @@ WebInspector.ScreencastView.prototype = {
this._updateGlasspane();
},
- /**
- * @param {boolean} on
- * @private
- */
- _onTimeline: function(on)
+ _onTimeline: function()
{
- this._timelineActive = on;
+ this._timelineActive = this._isTimelineActive();
if (this._timelineActive)
this._stopCasting();
else
@@ -203,12 +199,11 @@ WebInspector.ScreencastView.prototype = {
},
/**
- * @param {boolean} on
* @param {!WebInspector.Event} event
- * @private
*/
- _onProfiler: function(on, event) {
- this._profilerActive = on;
+ _onProfiler: function(event)
+ {
+ this._profilerActive = this._isProfilerActive();
if (this._profilerActive)
this._stopCasting();
else
@@ -923,6 +918,16 @@ WebInspector.ScreencastView.prototype = {
return true;
},
+ _isTimelineActive: function()
+ {
+ return WebInspector.targetManager.targets().some(function(target){ return target.timelineManager.isStarted();});
+ },
+
+ _isProfilerActive: function()
+ {
+ return WebInspector.targetManager.targets().some(function(target){ return target.cpuProfilerModel.isRecordingProfile();});
+ },
+
__proto__: WebInspector.VBox.prototype
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698