Chromium Code Reviews| Index: extensions/renderer/api_binding_hooks.h |
| diff --git a/extensions/renderer/api_binding_hooks.h b/extensions/renderer/api_binding_hooks.h |
| index d6620275017e656fc0182af51f7fdc2d69d78c12..8abe227661b86f1f8dd390db90e842bfc428f1a1 100644 |
| --- a/extensions/renderer/api_binding_hooks.h |
| +++ b/extensions/renderer/api_binding_hooks.h |
| @@ -49,7 +49,8 @@ class APIBindingHooks { |
| base::Callback<RequestResult(const APISignature*, |
| v8::Local<v8::Context> context, |
| std::vector<v8::Local<v8::Value>>*, |
| - const ArgumentSpec::RefMap&)>; |
| + const ArgumentSpec::RefMap&, |
| + v8::Local<v8::Value>* return_value)>; |
| explicit APIBindingHooks(const binding::RunJSFunctionSync& run_js); |
| ~APIBindingHooks(); |
| @@ -68,14 +69,15 @@ class APIBindingHooks { |
| const std::string& api_name); |
| // Looks for a custom hook to handle the given request and, if one exists, |
| - // runs it. Returns the result of trying to run the hook, or NOT_HANDLED if no |
| - // hook was found. |
| + // runs it. Returns the result of running the hook, if any. Populates |
| + // |return_value| with a value to return, if any. |
| RequestResult HandleRequest(const std::string& api_name, |
| const std::string& method_name, |
| v8::Local<v8::Context> context, |
| const APISignature* signature, |
| std::vector<v8::Local<v8::Value>>* arguments, |
| - const ArgumentSpec::RefMap& type_refs); |
| + const ArgumentSpec::RefMap& type_refs, |
| + v8::Local<v8::Value>* return_value); |
|
jbroman
2017/01/02 20:05:46
nit: This argument list is getting a little long.
Devlin
2017/01/04 18:38:07
Hmm... it makes it seem a little more verbose to m
|
| // Returns a JS interface that can be used to register hooks. |
| v8::Local<v8::Object> GetJSHookInterface(const std::string& api_name, |