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

Unified Diff: Source/devtools/front_end/profiler/ProfilesPanel.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/profiler/ProfilesPanel.js
diff --git a/Source/devtools/front_end/profiler/ProfilesPanel.js b/Source/devtools/front_end/profiler/ProfilesPanel.js
index 81f16168e936236e9b45937c5238994d52ddb060..44dd77b7ee2425cbda916e7ccc53a3ebf259cdf3 100644
--- a/Source/devtools/front_end/profiler/ProfilesPanel.js
+++ b/Source/devtools/front_end/profiler/ProfilesPanel.js
@@ -238,9 +238,9 @@ WebInspector.ProfileType.prototype = {
setProfileBeingRecorded: function(profile)
{
if (this._profileBeingRecorded && this._profileBeingRecorded.target())
- this._profileBeingRecorded.target().profilingLock.release();
+ WebInspector.profilingLock.release();
if (profile && profile.target())
- profile.target().profilingLock.acquire();
+ WebInspector.profilingLock.acquire();
this._profileBeingRecorded = profile;
},
@@ -440,7 +440,6 @@ WebInspector.ProfileHeader.prototype = {
* @constructor
* @implements {WebInspector.Searchable}
* @implements {WebInspector.ProfileType.DataDisplayDelegate}
- * @implements {WebInspector.TargetManager.Observer}
* @extends {WebInspector.PanelWithSidebarTree}
*/
WebInspector.ProfilesPanel = function()
@@ -501,27 +500,11 @@ WebInspector.ProfilesPanel = function()
this.element.addEventListener("contextmenu", this._handleContextMenuEvent.bind(this), true);
this._registerShortcuts();
- WebInspector.targetManager.observeTargets(this);
+ WebInspector.profilingLock.addEventListener(WebInspector.Lock.Events.StateChanged, this._onProfilingStateChanged, this);
}
WebInspector.ProfilesPanel.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()
@@ -617,7 +600,7 @@ WebInspector.ProfilesPanel.prototype = {
{
if (WebInspector.experimentsSettings.disableAgentsWhenProfile.isEnabled())
WebInspector.inspectorView.setCurrentPanelLocked(toggled);
- var isAcquiredInSomeTarget = WebInspector.targetManager.targets().some(function(target) { return target.profilingLock.isAcquired(); });
+ var isAcquiredInSomeTarget = WebInspector.profilingLock.isAcquired();
var enable = toggled || !isAcquiredInSomeTarget;
this.recordButton.setEnabled(enable);
this.recordButton.toggled = toggled;

Powered by Google App Engine
This is Rietveld 408576698