| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef EXTENSIONS_RENDERER_API_BINDINGS_SYSTEM_H_ | 5 #ifndef EXTENSIONS_RENDERER_API_BINDINGS_SYSTEM_H_ |
| 6 #define EXTENSIONS_RENDERER_API_BINDINGS_SYSTEM_H_ | 6 #define EXTENSIONS_RENDERER_API_BINDINGS_SYSTEM_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 | 102 |
| 103 // A map from api_name -> APIBinding for constructed APIs. APIBindings are | 103 // A map from api_name -> APIBinding for constructed APIs. APIBindings are |
| 104 // created lazily. | 104 // created lazily. |
| 105 std::map<std::string, std::unique_ptr<APIBinding>> api_bindings_; | 105 std::map<std::string, std::unique_ptr<APIBinding>> api_bindings_; |
| 106 | 106 |
| 107 // A map from api_name -> APIBindingHooks for registering custom hooks. | 107 // A map from api_name -> APIBindingHooks for registering custom hooks. |
| 108 // TODO(devlin): This map is pretty pointer-y. Is that going to be a | 108 // TODO(devlin): This map is pretty pointer-y. Is that going to be a |
| 109 // performance concern? | 109 // performance concern? |
| 110 std::map<std::string, std::unique_ptr<APIBindingHooks>> binding_hooks_; | 110 std::map<std::string, std::unique_ptr<APIBindingHooks>> binding_hooks_; |
| 111 | 111 |
| 112 binding::RunJSFunction call_js_; |
| 113 |
| 112 // The method to retrieve the DictionaryValue describing a given extension | 114 // The method to retrieve the DictionaryValue describing a given extension |
| 113 // API. Curried in for testing purposes so we can use fake APIs. | 115 // API. Curried in for testing purposes so we can use fake APIs. |
| 114 GetAPISchemaMethod get_api_schema_; | 116 GetAPISchemaMethod get_api_schema_; |
| 115 | 117 |
| 116 // The method to call when a new API call is triggered. Curried in for testing | 118 // The method to call when a new API call is triggered. Curried in for testing |
| 117 // purposes. Typically, this would send an IPC to the browser to begin the | 119 // purposes. Typically, this would send an IPC to the browser to begin the |
| 118 // function work. | 120 // function work. |
| 119 SendRequestMethod send_request_; | 121 SendRequestMethod send_request_; |
| 120 | 122 |
| 121 DISALLOW_COPY_AND_ASSIGN(APIBindingsSystem); | 123 DISALLOW_COPY_AND_ASSIGN(APIBindingsSystem); |
| 122 }; | 124 }; |
| 123 | 125 |
| 124 } // namespace | 126 } // namespace |
| 125 | 127 |
| 126 #endif // EXTENSIONS_RENDERER_API_BINDINGS_SYSTEM_H_ | 128 #endif // EXTENSIONS_RENDERER_API_BINDINGS_SYSTEM_H_ |
| OLD | NEW |