| 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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 | 98 |
| 99 // A map from api_name -> APIBinding for constructed APIs. APIBindings are | 99 // A map from api_name -> APIBinding for constructed APIs. APIBindings are |
| 100 // created lazily. | 100 // created lazily. |
| 101 std::map<std::string, std::unique_ptr<APIBinding>> api_bindings_; | 101 std::map<std::string, std::unique_ptr<APIBinding>> api_bindings_; |
| 102 | 102 |
| 103 // A map from api_name -> APIBindingHooks for registering custom hooks. | 103 // A map from api_name -> APIBindingHooks for registering custom hooks. |
| 104 // TODO(devlin): This map is pretty pointer-y. Is that going to be a | 104 // TODO(devlin): This map is pretty pointer-y. Is that going to be a |
| 105 // performance concern? | 105 // performance concern? |
| 106 std::map<std::string, std::unique_ptr<APIBindingHooks>> binding_hooks_; | 106 std::map<std::string, std::unique_ptr<APIBindingHooks>> binding_hooks_; |
| 107 | 107 |
| 108 binding::RunJSFunction call_js_; |
| 109 |
| 108 // The method to retrieve the DictionaryValue describing a given extension | 110 // The method to retrieve the DictionaryValue describing a given extension |
| 109 // API. Curried in for testing purposes so we can use fake APIs. | 111 // API. Curried in for testing purposes so we can use fake APIs. |
| 110 GetAPISchemaMethod get_api_schema_; | 112 GetAPISchemaMethod get_api_schema_; |
| 111 | 113 |
| 112 // The method to call when a new API call is triggered. Curried in for testing | 114 // The method to call when a new API call is triggered. Curried in for testing |
| 113 // purposes. Typically, this would send an IPC to the browser to begin the | 115 // purposes. Typically, this would send an IPC to the browser to begin the |
| 114 // function work. | 116 // function work. |
| 115 SendRequestMethod send_request_; | 117 SendRequestMethod send_request_; |
| 116 | 118 |
| 117 DISALLOW_COPY_AND_ASSIGN(APIBindingsSystem); | 119 DISALLOW_COPY_AND_ASSIGN(APIBindingsSystem); |
| 118 }; | 120 }; |
| 119 | 121 |
| 120 } // namespace | 122 } // namespace |
| 121 | 123 |
| 122 #endif // EXTENSIONS_RENDERER_API_BINDINGS_SYSTEM_H_ | 124 #endif // EXTENSIONS_RENDERER_API_BINDINGS_SYSTEM_H_ |
| OLD | NEW |