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

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

Issue 475803002: Make profiling lock global rather than per Target (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Extracted Lock.js Created 6 years, 4 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 f2c242f0c2a0bc6ae050e58c2f654d6d5d9fc811..0728cd94ab462577db696a1eb389342556351bd9 100644
--- a/Source/devtools/front_end/timeline/TimelinePanel.js
+++ b/Source/devtools/front_end/timeline/TimelinePanel.js
@@ -34,7 +34,6 @@
* @extends {WebInspector.Panel}
* @implements {WebInspector.TimelineModeViewDelegate}
* @implements {WebInspector.Searchable}
- * @implements {WebInspector.TargetManager.Observer}
*/
WebInspector.TimelinePanel = function()
{
@@ -124,6 +123,7 @@ WebInspector.TimelinePanel = function()
this._onModeChanged();
this._detailsSplitView.show(this.element);
+ WebInspector.profilingLock.addEventListener(WebInspector.Lock.Events.StateChanged, this._onProfilingStateChanged, this);
}
WebInspector.TimelinePanel.OverviewMode = {
@@ -139,22 +139,6 @@ WebInspector.TimelinePanel.durationFilterPresetsMs = [0, 1, 15];
WebInspector.TimelinePanel.prototype = {
/**
- * @param {!WebInspector.Target} target
- */
- targetAdded: function(target)
- {
- target.profilingLock.addEventListener(WebInspector.Lock.Events.StateChanged, this._onProfilingStateChanged, this);
- },
-
- /**
- * @param {!WebInspector.Target} target
- */
- targetRemoved: function(target)
- {
- target.profilingLock.removeEventListener(WebInspector.Lock.Events.StateChanged, this._onProfilingStateChanged, this);
- },
-
- /**
* @return {?WebInspector.SearchableView}
*/
searchableView: function()
@@ -690,7 +674,7 @@ WebInspector.TimelinePanel.prototype = {
*/
_updateToggleTimelineButton: function(toggled)
{
- var isAcquiredInSomeTarget = WebInspector.targetManager.targets().some(function(target) { return target.profilingLock.isAcquired(); });
+ var isAcquiredInSomeTarget = WebInspector.profilingLock.isAcquired();
this.toggleTimelineButton.toggled = toggled;
if (toggled) {
this.toggleTimelineButton.title = WebInspector.UIString("Stop");

Powered by Google App Engine
This is Rietveld 408576698