Chromium Code Reviews| Index: third_party/WebKit/Source/devtools/front_end/components/ExecutionContextSelector.js |
| diff --git a/third_party/WebKit/Source/devtools/front_end/components/ExecutionContextSelector.js b/third_party/WebKit/Source/devtools/front_end/components/ExecutionContextSelector.js |
| index 442321322d2a0efb5c1c9d7d100a069045bed320..f61d9dfb4997a7b615ee41d1d2c38e8fe1ae5dbd 100644 |
| --- a/third_party/WebKit/Source/devtools/front_end/components/ExecutionContextSelector.js |
| +++ b/third_party/WebKit/Source/devtools/front_end/components/ExecutionContextSelector.js |
| @@ -10,7 +10,7 @@ |
| */ |
| WebInspector.ExecutionContextSelector = function(targetManager, context) |
| { |
| - targetManager.observeTargets(this); |
| + targetManager.observeTargets(this, WebInspector.Target.Capability.JS); |
| context.addFlavorChangeListener(WebInspector.ExecutionContext, this._executionContextChanged, this); |
| context.addFlavorChangeListener(WebInspector.Target, this._targetChanged, this); |
| @@ -28,8 +28,6 @@ WebInspector.ExecutionContextSelector.prototype = { |
| */ |
| targetAdded: function(target) |
| { |
| - if (!target.hasJSContext()) |
| - return; |
| // Defer selecting default target since we need all clients to get their |
| // targetAdded notifications first. |
| setImmediate(deferred.bind(this)); |
| @@ -51,13 +49,11 @@ WebInspector.ExecutionContextSelector.prototype = { |
| */ |
| targetRemoved: function(target) |
| { |
| - if (!target.hasJSContext()) |
| - return; |
| var currentExecutionContext = this._context.flavor(WebInspector.ExecutionContext); |
| if (currentExecutionContext && currentExecutionContext.target() === target) |
| this._currentExecutionContextGone(); |
| - var targets = this._targetManager.targetsWithJSContext(); |
| + var targets = this._targetManager.targets(WebInspector.Target.Capability.JS); |
| if (this._context.flavor(WebInspector.Target) === target && targets.length) |
| this._context.setFlavor(WebInspector.Target, targets[0]); |
| }, |
| @@ -165,10 +161,10 @@ WebInspector.ExecutionContextSelector.prototype = { |
| _currentExecutionContextGone: function() |
| { |
| - var targets = this._targetManager.targetsWithJSContext(); |
| + var targets = this._targetManager.targets(WebInspector.Target.Capability.JS); |
| var newContext = null; |
| for (var i = 0; i < targets.length && !newContext; ++i) { |
| - if (targets[i].isServiceWorker()) |
| + if (!targets[i].hasJSCapability()) |
|
dgozman
2016/07/13 00:08:29
It should have it due to parameter passed to targe
eostroukhov-old
2016/07/13 00:36:29
Done.
|
| continue; |
| var executionContexts = targets[i].runtimeModel.executionContexts(); |
| for (var executionContext of executionContexts) { |