| 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_NATIVE_EXTENSION_BINDINGS_SYSTEM_H_ | 5 #ifndef EXTENSIONS_RENDERER_NATIVE_EXTENSION_BINDINGS_SYSTEM_H_ |
| 6 #define EXTENSIONS_RENDERER_NATIVE_EXTENSION_BINDINGS_SYSTEM_H_ | 6 #define EXTENSIONS_RENDERER_NATIVE_EXTENSION_BINDINGS_SYSTEM_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 ScriptContext* context) override; | 51 ScriptContext* context) override; |
| 52 void HandleResponse(int request_id, | 52 void HandleResponse(int request_id, |
| 53 bool success, | 53 bool success, |
| 54 const base::ListValue& response, | 54 const base::ListValue& response, |
| 55 const std::string& error) override; | 55 const std::string& error) override; |
| 56 RequestSender* GetRequestSender() override; | 56 RequestSender* GetRequestSender() override; |
| 57 | 57 |
| 58 private: | 58 private: |
| 59 // Handles sending a given |request|, forwarding it on to the send_ipc_ after | 59 // Handles sending a given |request|, forwarding it on to the send_ipc_ after |
| 60 // adding additional info. | 60 // adding additional info. |
| 61 void SendRequest(std::unique_ptr<APIBinding::Request> request, | 61 void SendRequest(std::unique_ptr<APIRequestHandler::Request> request, |
| 62 v8::Local<v8::Context> context); | 62 v8::Local<v8::Context> context); |
| 63 | 63 |
| 64 // Called when listeners for a given event have changed, and forwards it along | 64 // Called when listeners for a given event have changed, and forwards it along |
| 65 // to |send_event_listener_ipc_|. | 65 // to |send_event_listener_ipc_|. |
| 66 void OnEventListenerChanged(const std::string& event_name, | 66 void OnEventListenerChanged(const std::string& event_name, |
| 67 binding::EventListenersChanged change, | 67 binding::EventListenersChanged change, |
| 68 v8::Local<v8::Context> context); | 68 v8::Local<v8::Context> context); |
| 69 | 69 |
| 70 // Getter callback for an extension API, since APIs are constructed lazily. | 70 // Getter callback for an extension API, since APIs are constructed lazily. |
| 71 static void BindingAccessor(v8::Local<v8::Name> name, | 71 static void BindingAccessor(v8::Local<v8::Name> name, |
| (...skipping 23 matching lines...) Expand all Loading... |
| 95 v8::Eternal<v8::FunctionTemplate> get_internal_api_; | 95 v8::Eternal<v8::FunctionTemplate> get_internal_api_; |
| 96 | 96 |
| 97 base::WeakPtrFactory<NativeExtensionBindingsSystem> weak_factory_; | 97 base::WeakPtrFactory<NativeExtensionBindingsSystem> weak_factory_; |
| 98 | 98 |
| 99 DISALLOW_COPY_AND_ASSIGN(NativeExtensionBindingsSystem); | 99 DISALLOW_COPY_AND_ASSIGN(NativeExtensionBindingsSystem); |
| 100 }; | 100 }; |
| 101 | 101 |
| 102 } // namespace extensions | 102 } // namespace extensions |
| 103 | 103 |
| 104 #endif // EXTENSIONS_RENDERER_NATIVE_EXTENSION_BINDINGS_SYSTEM_H_ | 104 #endif // EXTENSIONS_RENDERER_NATIVE_EXTENSION_BINDINGS_SYSTEM_H_ |
| OLD | NEW |