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

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

Issue 2250473002: DevTools: Repick execution context when frames are loaded (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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: 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);

Powered by Google App Engine
This is Rietveld 408576698