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

Unified Diff: Source/devtools/front_end/profiler/ProfilesPanel.js

Issue 471393002: Revert of Make profiling lock global rather than per Target (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 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 44dd77b7ee2425cbda916e7ccc53a3ebf259cdf3..81f16168e936236e9b45937c5238994d52ddb060 100644
--- a/Source/devtools/front_end/profiler/ProfilesPanel.js
+++ b/Source/devtools/front_end/profiler/ProfilesPanel.js
@@ -238,9 +238,9 @@
setProfileBeingRecorded: function(profile)
{
if (this._profileBeingRecorded && this._profileBeingRecorded.target())
- WebInspector.profilingLock.release();
+ this._profileBeingRecorded.target().profilingLock.release();
if (profile && profile.target())
- WebInspector.profilingLock.acquire();
+ profile.target().profilingLock.acquire();
this._profileBeingRecorded = profile;
},
@@ -440,6 +440,7 @@
* @constructor
* @implements {WebInspector.Searchable}
* @implements {WebInspector.ProfileType.DataDisplayDelegate}
+ * @implements {WebInspector.TargetManager.Observer}
* @extends {WebInspector.PanelWithSidebarTree}
*/
WebInspector.ProfilesPanel = function()
@@ -500,10 +501,26 @@
this.element.addEventListener("contextmenu", this._handleContextMenuEvent.bind(this), true);
this._registerShortcuts();
- WebInspector.profilingLock.addEventListener(WebInspector.Lock.Events.StateChanged, this._onProfilingStateChanged, this);
+ WebInspector.targetManager.observeTargets(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}
*/
@@ -600,7 +617,7 @@
{
if (WebInspector.experimentsSettings.disableAgentsWhenProfile.isEnabled())
WebInspector.inspectorView.setCurrentPanelLocked(toggled);
- var isAcquiredInSomeTarget = WebInspector.profilingLock.isAcquired();
+ var isAcquiredInSomeTarget = WebInspector.targetManager.targets().some(function(target) { return target.profilingLock.isAcquired(); });
var enable = toggled || !isAcquiredInSomeTarget;
this.recordButton.setEnabled(enable);
this.recordButton.toggled = toggled;
« no previous file with comments | « Source/devtools/front_end/profiler/CanvasProfileView.js ('k') | Source/devtools/front_end/sdk/CSSStyleModel.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698