Chromium Code Reviews| Index: extensions/renderer/api_bindings_system.h |
| diff --git a/extensions/renderer/api_bindings_system.h b/extensions/renderer/api_bindings_system.h |
| index e40b898bcee5c215150694c27dd9ba494f2477f1..e8f30cf9f4ff95ce8828b840db03c0304cae3454 100644 |
| --- a/extensions/renderer/api_bindings_system.h |
| +++ b/extensions/renderer/api_bindings_system.h |
| @@ -70,6 +70,11 @@ class APIBindingsSystem { |
| v8::Local<v8::Context> context, |
| const base::ListValue& response); |
| + // Returns the APIBindingHooks object for the given api to allow for |
| + // registering custom hooks. These must be registered *before* the |
| + // binding is instantiated. |
| + APIBindingHooks* GetHooksForAPI(const std::string& api_name); |
|
jbroman
2016/12/08 16:58:56
The use of GetHooksForAPI to do the registration s
Devlin
2016/12/08 19:12:03
I wasn't sure there was much useful to test here (
|
| + |
|
jbroman
2016/12/08 16:58:56
Is there a reason for the asymmetry, where API sch
Devlin
2016/12/08 19:12:03
Let's say we have a custom hook (call it CustomHoo
|
| private: |
| // Creates a new APIBinding for the given |api_name|. |
| std::unique_ptr<APIBinding> CreateNewAPIBinding(const std::string& api_name); |
| @@ -95,6 +100,9 @@ class APIBindingsSystem { |
| // created lazily. |
| std::map<std::string, std::unique_ptr<APIBinding>> api_bindings_; |
| + // A map from api_name -> APIBindingHooks for registering custom hooks. |
| + std::map<std::string, std::unique_ptr<APIBindingHooks>> binding_hooks_; |
|
jbroman
2016/12/08 16:58:56
We might want to watch out for this later -- it is
Devlin
2016/12/08 19:12:03
Added a note in the code.
|
| + |
| // The method to retrieve the DictionaryValue describing a given extension |
| // API. Curried in for testing purposes so we can use fake APIs. |
| GetAPISchemaMethod get_api_schema_; |