Index: Source/devtools/front_end/sdk/RemoteObject.js |
diff --git a/Source/devtools/front_end/sdk/RemoteObject.js b/Source/devtools/front_end/sdk/RemoteObject.js |
index b465eb2d046a9c0b08290bebb3e0b603d9a68d70..1c992cfd747fa447477f2d25f28ec762bb8662c0 100644 |
--- a/Source/devtools/front_end/sdk/RemoteObject.js |
+++ b/Source/devtools/front_end/sdk/RemoteObject.js |
@@ -117,7 +117,7 @@ WebInspector.RemoteObject.prototype = { |
/** |
* @param {boolean} accessorPropertiesOnly |
- * @param {function(?Array.<!WebInspector.RemoteObjectProperty>, ?Array.<!WebInspector.RemoteObjectProperty>)} callback |
+ * @param {function(?Array<!WebInspector.RemoteObjectProperty>, ?Array<!WebInspector.RemoteObjectProperty>)} callback |
*/ |
getAllProperties: function(accessorPropertiesOnly, callback) |
{ |
@@ -125,6 +125,37 @@ WebInspector.RemoteObject.prototype = { |
}, |
/** |
+ * @param {boolean} accessorPropertiesOnly |
+ * @return {!Promise<!{properties: ?Array<!WebInspector.RemoteObjectProperty>, internalProperties: ?Array<!WebInspector.RemoteObjectProperty>}>} |
+ */ |
+ getAllPropertiesPromise: function(accessorPropertiesOnly) |
+ { |
+ return new Promise(promiseConstructor.bind(this)); |
+ |
+ /** |
+ * @param {function(!{properties: ?Array<!WebInspector.RemoteObjectProperty>, internalProperties: ?Array.<!WebInspector.RemoteObjectProperty>})} success |
+ * @this {WebInspector.RemoteObject} |
+ */ |
+ function promiseConstructor(success) |
+ { |
+ this.getAllProperties(accessorPropertiesOnly, getAllPropertiesCallback.bind(null, success)); |
+ } |
+ |
+ /** |
+ * @param {function(!{properties: ?Array<!WebInspector.RemoteObjectProperty>, internalProperties: ?Array<!WebInspector.RemoteObjectProperty>})} callback |
+ * @param {?Array<!WebInspector.RemoteObjectProperty>} properties |
+ * @param {?Array<!WebInspector.RemoteObjectProperty>} internalProperties |
+ */ |
+ function getAllPropertiesCallback(callback, properties, internalProperties) |
+ { |
+ callback({ |
+ properties: properties, |
+ internalProperties: internalProperties |
+ }); |
+ } |
+ }, |
+ |
+ /** |
* @return {!Promise<?Array<!WebInspector.EventListener>>} |
*/ |
eventListeners: function() |
@@ -185,7 +216,7 @@ WebInspector.RemoteObject.prototype = { |
/** |
* @param {function(this:Object)} functionDeclaration |
- * @param {!Array.<!RuntimeAgent.CallArgument>|undefined} args |
+ * @param {!Array<!RuntimeAgent.CallArgument>|undefined} args |
* @param {function(*)} callback |
*/ |
callFunctionJSON: function(functionDeclaration, args, callback) |
@@ -194,6 +225,24 @@ WebInspector.RemoteObject.prototype = { |
}, |
/** |
+ * @param {function(this:Object)} functionDeclaration |
+ * @param {!Array<!RuntimeAgent.CallArgument>|undefined} args |
+ * @return {!Promise<*>} |
+ */ |
+ callFunctionJSONPromise: function(functionDeclaration, args) |
+ { |
+ return new Promise(promiseConstructor.bind(this)); |
+ |
+ /** |
+ * @this {WebInspector.RemoteObject} |
+ */ |
+ function promiseConstructor(success) |
+ { |
+ this.callFunctionJSON(functionDeclaration, args, success); |
+ } |
+ }, |
+ |
+ /** |
* @return {!WebInspector.Target} |
*/ |
target: function() |
@@ -226,6 +275,23 @@ WebInspector.RemoteObject.prototype = { |
}, |
/** |
+ * @return {!Promise<?WebInspector.DebuggerModel.FunctionDetails>} |
+ */ |
+ functionDetailsPromise: function() |
+ { |
+ return new Promise(promiseConstructor.bind(this)); |
+ |
+ /** |
+ * @param {function(?WebInspector.DebuggerModel.FunctionDetails)} success |
+ * @this {WebInspector.RemoteObject} |
+ */ |
+ function promiseConstructor(success) |
+ { |
+ this.functionDetails(success); |
+ } |
+ }, |
+ |
+ /** |
* @param {function(?WebInspector.DebuggerModel.GeneratorObjectDetails)} callback |
*/ |
generatorObjectDetails: function(callback) |
@@ -234,11 +300,45 @@ WebInspector.RemoteObject.prototype = { |
}, |
/** |
- * @param {function(?Array.<!DebuggerAgent.CollectionEntry>)} callback |
+ * @return {!Promise<?WebInspector.DebuggerModel.GeneratorObjectDetails>} |
+ */ |
+ generatorObjectDetailsPromise: function() |
pfeldman
2015/08/25 00:55:24
Do you need all of these?
|
+ { |
+ return new Promise(promiseConstructor.bind(this)); |
+ |
+ /** |
+ * @param {function(?WebInspector.DebuggerModel.GeneratorObjectDetails)} success |
+ * @this {WebInspector.RemoteObject} |
+ */ |
+ function promiseConstructor(success) |
+ { |
+ this.generatorObjectDetails(success); |
+ } |
+ }, |
+ |
+ /** |
+ * @param {function(?Array<!DebuggerAgent.CollectionEntry>)} callback |
*/ |
collectionEntries: function(callback) |
{ |
callback(null); |
+ }, |
+ |
+ /** |
+ * @return {!Promise<?Array<!DebuggerAgent.CollectionEntry>>} |
+ */ |
+ collectionEntriesPromise: function() |
+ { |
+ return new Promise(promiseConstructor.bind(this)); |
+ |
+ /** |
+ * @param {function(?Array<!DebuggerAgent.CollectionEntry>)} success |
+ * @this {WebInspector.RemoteObject} |
+ */ |
+ function promiseConstructor(success) |
+ { |
+ this.collectionEntries(success); |
+ } |
} |
} |