Chromium Code Reviews| 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..bdf44c48a048f83fe35d4ca65ebb4366c47e1846 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, [ |
| + return this._removeFunction.callFunctionPromise(callCustomRemove, [ |
| WebInspector.RemoteObject.toCallArgument(this._removeFunction), |
| 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 {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); |
|
dgozman
2016/06/01 23:54:05
Let's use |this| instead of |func|.
kozy
2016/06/02 01:04:39
Done.
|
| } |
| }, |