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

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

Issue 2034533002: [DevTools] Add removeFunction to EventListener protocol object (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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 30316e2572210c8b439622bb56c7c1da5537444e..5b8888679ee865e76c3d34e12b5d0ea568549658 100644
--- a/third_party/WebKit/Source/devtools/front_end/sdk/RuntimeModel.js
+++ b/third_party/WebKit/Source/devtools/front_end/sdk/RuntimeModel.js
@@ -810,33 +810,24 @@ WebInspector.EventListener.prototype = {
{
if (!this._removeFunction)
return Promise.resolve();
- return new Promise(promiseConstructor.bind(this));
-
- /**
- * @param {function()} success
- * @this {WebInspector.EventListener}
- */
- function promiseConstructor(success)
- {
- this._removeFunction.callFunction(callCustomRemove, [
- WebInspector.RemoteObject.toCallArgument(this._removeFunction),
+ 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),
- ], success);
+ ]).then(() => undefined);
- /**
- * @param {function(string, function(), boolean, boolean)} func
- * @param {string} type
- * @param {function()} listener
- * @param {boolean} useCapture
- * @param {boolean} passive
- */
- function callCustomRemove(func, type, listener, useCapture, passive)
- {
- func.call(null, type, listener, useCapture, passive);
- }
+ /**
+ * @param {string} type
+ * @param {function()} listener
+ * @param {boolean} useCapture
+ * @param {boolean} passive
+ * @this {Function}
+ * @suppressReceiverCheck
+ */
+ function callCustomRemove(type, listener, useCapture, passive)
+ {
+ this.call(null, type, listener, useCapture, passive);
}
},
« no previous file with comments | « third_party/WebKit/Source/devtools/front_end/sdk/RemoteObject.js ('k') | third_party/WebKit/Source/devtools/protocol.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698