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

Unified Diff: third_party/WebKit/Source/devtools/front_end/sdk/RuntimeModel.js

Issue 2136763002: DevTools: Sort execution contexts in nested frames (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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: third_party/WebKit/Source/devtools/front_end/sdk/RuntimeModel.js
diff --git a/third_party/WebKit/Source/devtools/front_end/sdk/RuntimeModel.js b/third_party/WebKit/Source/devtools/front_end/sdk/RuntimeModel.js
index c83a4fa67a2597511dc650d7421fe9c6b2c13c81..7019a85d6d8b18e1eec1aa245b9ad67fcd162ca9 100644
--- a/third_party/WebKit/Source/devtools/front_end/sdk/RuntimeModel.js
+++ b/third_party/WebKit/Source/devtools/front_end/sdk/RuntimeModel.js
@@ -45,6 +45,7 @@ WebInspector.RuntimeModel = function(target)
* @type {!Object.<number, !WebInspector.ExecutionContext>}
*/
this._executionContextById = {};
+ this._executionContextComparator = WebInspector.ExecutionContext.comparator;
pfeldman 2016/07/09 02:02:09 We can now remove the frameId-related logic from t
einbinder 2016/07/11 18:40:14 Done.
if (WebInspector.moduleSetting("customFormatters").get())
this._agent.setCustomObjectFormatterEnabled(true);
@@ -67,7 +68,23 @@ WebInspector.RuntimeModel.prototype = {
*/
executionContexts: function()
{
- return Object.values(this._executionContextById);
+ return Object.values(this._executionContextById).sort(this.executionContextComparator());
+ },
+
+ /**
+ * @param {function(!WebInspector.ExecutionContext,!WebInspector.ExecutionContext)} comparator
+ */
+ setExecutionContextComparator: function(comparator)
+ {
+ this._executionContextComparator = comparator;
+ },
+
+ /**
+ * @return {function(!WebInspector.ExecutionContext,!WebInspector.ExecutionContext)} comparator
+ */
+ executionContextComparator: function()
+ {
+ return this._executionContextComparator;
},
/**
@@ -813,11 +830,11 @@ WebInspector.EventListener.prototype = {
if (!this._removeFunction)
return Promise.resolve();
return this._removeFunction.callFunctionPromise(callCustomRemove, [
- WebInspector.RemoteObject.toCallArgument(this._type),
- WebInspector.RemoteObject.toCallArgument(this._originalHandler),
- WebInspector.RemoteObject.toCallArgument(this._useCapture),
- WebInspector.RemoteObject.toCallArgument(this._passive),
- ]).then(() => undefined);
+ WebInspector.RemoteObject.toCallArgument(this._type),
+ WebInspector.RemoteObject.toCallArgument(this._originalHandler),
+ WebInspector.RemoteObject.toCallArgument(this._useCapture),
+ WebInspector.RemoteObject.toCallArgument(this._passive),
+ ]).then(() => undefined);
/**
* @param {string} type

Powered by Google App Engine
This is Rietveld 408576698