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 932dcbc00cef7719f1f8fd76a23e6c4d1625b5ca..e21c757bbcf7a663e10f7183fe7b9ed297c00977 100644 |
| --- a/third_party/WebKit/Source/devtools/front_end/components/ExecutionContextSelector.js |
| +++ b/third_party/WebKit/Source/devtools/front_end/components/ExecutionContextSelector.js |
| @@ -16,6 +16,7 @@ WebInspector.ExecutionContextSelector = function(targetManager, context) |
| targetManager.addModelListener(WebInspector.RuntimeModel, WebInspector.RuntimeModel.Events.ExecutionContextCreated, this._onExecutionContextCreated, this); |
| targetManager.addModelListener(WebInspector.RuntimeModel, WebInspector.RuntimeModel.Events.ExecutionContextDestroyed, this._onExecutionContextDestroyed, this); |
| + targetManager.addModelListener(WebInspector.RuntimeModel, WebInspector.RuntimeModel.Events.ResortExecutionContexts, this._onResortExecutionContexts, this); |
|
pfeldman
2016/08/16 16:28:28
ExecutionContextOrderChanged.
einbinder
2016/08/16 17:36:09
Done.
|
| this._targetManager = targetManager; |
| this._context = context; |
| } |
| @@ -159,6 +160,24 @@ WebInspector.ExecutionContextSelector.prototype = { |
| this._currentExecutionContextGone(); |
| }, |
| + /** |
| + * @param {!WebInspector.Event} event |
| + */ |
| + _onResortExecutionContexts: function(event) |
| + { |
| + var runtimeModel = /** @type {!WebInspector.RuntimeModel} */ (event.data); |
| + var executionContexts = runtimeModel.executionContexts(); |
| + for (var i = 0; i < executionContexts.length; i++) { |
| + var executionContext = executionContexts[i]; |
| + if (this._shouldSwitchToContext(executionContext)) { |
|
pfeldman
2016/08/16 16:28:28
_onExecutionContextCreated has similar semantics.
einbinder
2016/08/16 17:36:09
Done.
|
| + this._ignoreContextChanged = true; |
| + this._context.setFlavor(WebInspector.ExecutionContext, executionContext); |
| + this._ignoreContextChanged = false; |
| + break; |
| + } |
| + } |
| + }, |
| + |
| _currentExecutionContextGone: function() |
| { |
| var targets = this._targetManager.targets(WebInspector.Target.Capability.JS); |