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

Unified Diff: Source/devtools/front_end/timeline/TimelinePanel.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
« no previous file with comments | « Source/devtools/front_end/sdk/WorkerTargetManager.js ('k') | Source/devtools/scripts/frontend_modules.json » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 0728cd94ab462577db696a1eb389342556351bd9..f2c242f0c2a0bc6ae050e58c2f654d6d5d9fc811 100644
--- a/Source/devtools/front_end/timeline/TimelinePanel.js
+++ b/Source/devtools/front_end/timeline/TimelinePanel.js
@@ -34,6 +34,7 @@
* @extends {WebInspector.Panel}
* @implements {WebInspector.TimelineModeViewDelegate}
* @implements {WebInspector.Searchable}
+ * @implements {WebInspector.TargetManager.Observer}
*/
WebInspector.TimelinePanel = function()
{
@@ -123,7 +124,6 @@
this._onModeChanged();
this._detailsSplitView.show(this.element);
- WebInspector.profilingLock.addEventListener(WebInspector.Lock.Events.StateChanged, this._onProfilingStateChanged, this);
}
WebInspector.TimelinePanel.OverviewMode = {
@@ -138,6 +138,22 @@
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}
*/
@@ -674,7 +690,7 @@
*/
_updateToggleTimelineButton: function(toggled)
{
- var isAcquiredInSomeTarget = WebInspector.profilingLock.isAcquired();
+ var isAcquiredInSomeTarget = WebInspector.targetManager.targets().some(function(target) { return target.profilingLock.isAcquired(); });
this.toggleTimelineButton.toggled = toggled;
if (toggled) {
this.toggleTimelineButton.title = WebInspector.UIString("Stop");
« no previous file with comments | « Source/devtools/front_end/sdk/WorkerTargetManager.js ('k') | Source/devtools/scripts/frontend_modules.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698