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

Unified Diff: Source/devtools/front_end/components/ExecutionContextSelector.js

Issue 400633003: DevTools: introduce multitarget model listeners (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
Index: Source/devtools/front_end/components/ExecutionContextSelector.js
diff --git a/Source/devtools/front_end/components/ExecutionContextSelector.js b/Source/devtools/front_end/components/ExecutionContextSelector.js
index 1a85cca8dc059a506f8955b483bc0fceeb41a33f..2a3a5b2ef558df4384609da7eeca61841f1f4a2c 100644
--- a/Source/devtools/front_end/components/ExecutionContextSelector.js
+++ b/Source/devtools/front_end/components/ExecutionContextSelector.js
@@ -11,6 +11,9 @@ WebInspector.ExecutionContextSelector = function()
WebInspector.targetManager.observeTargets(this);
WebInspector.context.addFlavorChangeListener(WebInspector.ExecutionContext, this._executionContextChanged, this);
WebInspector.context.addFlavorChangeListener(WebInspector.Target, this._targetChanged, this);
+
+ WebInspector.targetManager.addModelListener(WebInspector.RuntimeModel, WebInspector.RuntimeModel.Events.ExecutionContextCreated, this._onExecutionContextCreated, this);
+ WebInspector.targetManager.addModelListener(WebInspector.RuntimeModel, WebInspector.RuntimeModel.Events.ExecutionContextDestroyed, this._onExecutionContextDestroyed, this);
}
WebInspector.ExecutionContextSelector.prototype = {
@@ -22,9 +25,6 @@ WebInspector.ExecutionContextSelector.prototype = {
{
if (!WebInspector.context.flavor(WebInspector.Target))
WebInspector.context.setFlavor(WebInspector.Target, target);
-
- target.runtimeModel.addEventListener(WebInspector.RuntimeModel.Events.ExecutionContextCreated, this._onExecutionContextCreated, this);
- target.runtimeModel.addEventListener(WebInspector.RuntimeModel.Events.ExecutionContextDestroyed, this._onExecutionContextDestroyed, this);
},
/**
@@ -32,8 +32,6 @@ WebInspector.ExecutionContextSelector.prototype = {
*/
targetRemoved: function(target)
{
- target.runtimeModel.removeEventListener(WebInspector.RuntimeModel.Events.ExecutionContextCreated, this._onExecutionContextCreated, this);
- target.runtimeModel.removeEventListener(WebInspector.RuntimeModel.Events.ExecutionContextDestroyed, this._onExecutionContextDestroyed, this);
var currentExecutionContext = WebInspector.context.flavor(WebInspector.ExecutionContext);
if (currentExecutionContext && currentExecutionContext.target() === target)
this._currentExecutionContextGone();
« no previous file with comments | « Source/devtools/front_end/components/DOMBreakpointsSidebarPane.js ('k') | Source/devtools/front_end/console/ConsoleView.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698