| 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 19 matching lines...) Expand all Loading... |
| 30 // for Extension APIs. Designed to be used on a single thread, but safe between | 30 // for Extension APIs. Designed to be used on a single thread, but safe between |
| 31 // multiple v8::Contexts. | 31 // multiple v8::Contexts. |
| 32 class APIBindingsSystem { | 32 class APIBindingsSystem { |
| 33 public: | 33 public: |
| 34 using GetAPISchemaMethod = | 34 using GetAPISchemaMethod = |
| 35 base::Callback<const base::DictionaryValue&(const std::string&)>; | 35 base::Callback<const base::DictionaryValue&(const std::string&)>; |
| 36 using CustomTypeHandler = | 36 using CustomTypeHandler = |
| 37 base::Callback<v8::Local<v8::Object>(v8::Local<v8::Context> context, | 37 base::Callback<v8::Local<v8::Object>(v8::Local<v8::Context> context, |
| 38 const std::string& property_name, | 38 const std::string& property_name, |
| 39 APIRequestHandler* request_handler, | 39 APIRequestHandler* request_handler, |
| 40 APIEventHandler* event_handler, |
| 40 APITypeReferenceMap* type_refs)>; | 41 APITypeReferenceMap* type_refs)>; |
| 41 | 42 |
| 42 APIBindingsSystem(const binding::RunJSFunction& call_js, | 43 APIBindingsSystem(const binding::RunJSFunction& call_js, |
| 43 const binding::RunJSFunctionSync& call_js_sync, | 44 const binding::RunJSFunctionSync& call_js_sync, |
| 44 const GetAPISchemaMethod& get_api_schema, | 45 const GetAPISchemaMethod& get_api_schema, |
| 45 const APIRequestHandler::SendRequestMethod& send_request, | 46 const APIRequestHandler::SendRequestMethod& send_request, |
| 46 const APIEventHandler::EventListenersChangedMethod& | 47 const APIEventHandler::EventListenersChangedMethod& |
| 47 event_listeners_changed, | 48 event_listeners_changed, |
| 48 APILastError last_error); | 49 APILastError last_error); |
| 49 ~APIBindingsSystem(); | 50 ~APIBindingsSystem(); |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 // The method to retrieve the DictionaryValue describing a given extension | 124 // The method to retrieve the DictionaryValue describing a given extension |
| 124 // API. Curried in for testing purposes so we can use fake APIs. | 125 // API. Curried in for testing purposes so we can use fake APIs. |
| 125 GetAPISchemaMethod get_api_schema_; | 126 GetAPISchemaMethod get_api_schema_; |
| 126 | 127 |
| 127 DISALLOW_COPY_AND_ASSIGN(APIBindingsSystem); | 128 DISALLOW_COPY_AND_ASSIGN(APIBindingsSystem); |
| 128 }; | 129 }; |
| 129 | 130 |
| 130 } // namespace | 131 } // namespace |
| 131 | 132 |
| 132 #endif // EXTENSIONS_RENDERER_API_BINDINGS_SYSTEM_H_ | 133 #endif // EXTENSIONS_RENDERER_API_BINDINGS_SYSTEM_H_ |
| OLD | NEW |