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

Unified Diff: Source/devtools/front_end/sdk/RemoteObject.js

Issue 1268353005: [DevTools] Support JQuery event listeners (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Implemented in frontend code Created 5 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: 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..b054ed04f161084b31bf423fbf6a8d7a7e7a1cdc 100644
--- a/Source/devtools/front_end/sdk/RemoteObject.js
+++ b/Source/devtools/front_end/sdk/RemoteObject.js
@@ -133,6 +133,24 @@ WebInspector.RemoteObject.prototype = {
},
/**
+ * @param {function(this:Node)} listenersGetter
+ * @return {!Promise<?Array<!WebInspector.EventListener>>}
+ */
+ frameworkEventListeners: function(listenersGetter)
+ {
+ throw "Not implemented";
+ },
+
+ /**
+ * @param {function(this:Node)} handlersGetter
+ * @return {!Promise<?Array<function()>>}
+ */
+ frameworkInternalEventHandlers: function(handlersGetter)
+ {
+ throw "Not implemented";
+ },
+
+ /**
* @param {!RuntimeAgent.CallArgument} name
* @param {function(string=)} callback
*/
@@ -194,6 +212,25 @@ 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));
+
+ /**
+ * @param {function(*)} success
+ * @this {WebInspector.RemoteObject}
+ */
+ function promiseConstructor(success)
+ {
+ this.callFunctionJSON(functionDeclaration, args, success);
+ }
+ },
+
+ /**
* @return {!WebInspector.Target}
*/
target: function()
@@ -489,12 +526,32 @@ WebInspector.RemoteObjectImpl.prototype = {
*/
function createEventListener(payload)
{
- return new WebInspector.EventListener(this._debuggerModel, payload, this._objectId);
+ return WebInspector.EventListener.fromPayload(this._debuggerModel, payload);
}
}
},
/**
+ * @override
+ * @param {function(this:Object)} listenersGetter
+ * @return {!Promise<?Array<!WebInspector.EventListener>>}
+ */
+ frameworkEventListeners: function(listenersGetter)
+ {
+ return this.callFunctionPromise(listenersGetter, undefined).then(WebInspector.castEventListeners);
+ },
+
+ /**
+ * @override
+ * @param {function(this:Object)} handlersGetter
+ * @return {!Promise<?Array<function()>>}
+ */
+ frameworkInternalEventHandlers: function(handlersGetter)
+ {
+ return this.callFunctionPromise(handlersGetter, undefined).then(WebInspector.castEventHandlers);
+ },
+
+ /**
* @param {!Array.<string>} propertyPath
* @param {function(?WebInspector.RemoteObject, boolean=)} callback
*/

Powered by Google App Engine
This is Rietveld 408576698