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

Unified Diff: third_party/WebKit/Source/devtools/front_end/Runtime.js

Issue 1413593008: DevTools: straw man adaptable implementation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/devtools/front_end/sdk/DOMModel.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/devtools/front_end/Runtime.js
diff --git a/third_party/WebKit/Source/devtools/front_end/Runtime.js b/third_party/WebKit/Source/devtools/front_end/Runtime.js
index 9056bd16ad155f40503f0416a86090019c83bd32..f27cccdaab8ed22a728c185730d0152a42dc708a 100644
--- a/third_party/WebKit/Source/devtools/front_end/Runtime.js
+++ b/third_party/WebKit/Source/devtools/front_end/Runtime.js
@@ -557,6 +557,27 @@ Runtime.prototype = {
this._cachedTypeClasses[typeName] = /** @type function(new:Object) */(object);
}
return this._cachedTypeClasses[typeName] || null;
+ },
+
+ /**
+ * @param {!Object} object
+ * @return {!Promise<!Array<!Object>>}
+ */
+ adapt: function(object)
+ {
+ return this.instancesPromise(Runtime.Adapter, object).then(processAdapters);
+
+ /**
+ * @param {!Array<!Runtime.Adapter>} adapters
+ * @return {!Promise<!Array<!Object>>}
+ */
+ function processAdapters(adapters)
+ {
+ var promises = [];
+ for (var adapter of adapters)
+ promises.push(adapter.adapt(object));
+ return /** @type {!Promise<!Array<!Object>>} */ (Runtime._some(promises));
+ }
}
}
@@ -1076,6 +1097,19 @@ Runtime.Experiment.prototype = {
}
}
+/**
+ * @interface
+ */
+Runtime.Adapter = function() { }
+
+Runtime.Adapter.prototype = {
+ /**
+ * @param {!Object} from
+ * @return {!Promise<?Object>}
+ */
+ adapt: function(from) { }
+}
+
{(function parseQueryParameters()
{
var queryParams = location.search;
« no previous file with comments | « no previous file | third_party/WebKit/Source/devtools/front_end/sdk/DOMModel.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698