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

Unified Diff: extensions/renderer/resources/binding.js

Issue 2952893002: [Extensions Bindings] Move setHandleRequestWithPromise to util (Closed)
Patch Set: lazyboy's Created 3 years, 6 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 | extensions/renderer/resources/mime_handler_private_custom_bindings.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/renderer/resources/binding.js
diff --git a/extensions/renderer/resources/binding.js b/extensions/renderer/resources/binding.js
index d25353b550f86d52d1993b0efdb8c792b1824fc4..d0b7e61b5e587c70d03056fce6cd79a72bfa13b6 100644
--- a/extensions/renderer/resources/binding.js
+++ b/extensions/renderer/resources/binding.js
@@ -70,36 +70,6 @@ APIFunctions.prototype.setHandleRequest =
});
};
-APIFunctions.prototype.setHandleRequestWithPromise =
- function(apiName, customizedFunction) {
- var prefix = this.namespace;
- return this.setHook_(apiName, 'handleRequest', function() {
- var name = prefix + '.' + apiName;
- logActivity.LogAPICall(extensionId, name, $Array.slice(arguments));
- var stack = exceptionHandler.getExtensionStackTrace();
- var callback = arguments[arguments.length - 1];
- var args = $Array.slice(arguments, 0, arguments.length - 1);
- var keepAlivePromise = requireAsync('keep_alive').then(function(module) {
- return module.createKeepAlive();
- });
- $Function.apply(customizedFunction, this, args).then(function(result) {
- if (callback) {
- exceptionHandler.safeCallbackApply(name, {'stack': stack}, callback,
- [result]);
- }
- }).catch(function(error) {
- if (callback) {
- var message = exceptionHandler.safeErrorToString(error, true);
- lastError.run(name, message, stack, callback);
- }
- }).then(function() {
- keepAlivePromise.then(function(keepAlive) {
- keepAlive.close();
- });
- });
- });
-};
-
APIFunctions.prototype.setUpdateArgumentsPostValidate =
function(apiName, customizedFunction) {
return this.setHook_(
« no previous file with comments | « no previous file | extensions/renderer/resources/mime_handler_private_custom_bindings.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698