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 CONTENT_COMMON_SERVICE_MANAGER_SERVICE_MANAGER_CONNECTION_IMPL_H_ | 5 #ifndef CONTENT_COMMON_SERVICE_MANAGER_SERVICE_MANAGER_CONNECTION_IMPL_H_ |
6 #define CONTENT_COMMON_SERVICE_MANAGER_SERVICE_MANAGER_CONNECTION_IMPL_H_ | 6 #define CONTENT_COMMON_SERVICE_MANAGER_SERVICE_MANAGER_CONNECTION_IMPL_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 19 matching lines...) Expand all Loading... |
30 service_manager::mojom::ServiceRequest request, | 30 service_manager::mojom::ServiceRequest request, |
31 scoped_refptr<base::SequencedTaskRunner> io_task_runner); | 31 scoped_refptr<base::SequencedTaskRunner> io_task_runner); |
32 ~ServiceManagerConnectionImpl() override; | 32 ~ServiceManagerConnectionImpl() override; |
33 | 33 |
34 private: | 34 private: |
35 class IOThreadContext; | 35 class IOThreadContext; |
36 | 36 |
37 // ServiceManagerConnection: | 37 // ServiceManagerConnection: |
38 void Start() override; | 38 void Start() override; |
39 service_manager::Connector* GetConnector() override; | 39 service_manager::Connector* GetConnector() override; |
40 const service_manager::ServiceInfo& GetLocalInfo() const override; | 40 const service_manager::BindSourceInfo& GetBrowserInfo() const override; |
41 const service_manager::ServiceInfo& GetBrowserInfo() const override; | |
42 void SetConnectionLostClosure(const base::Closure& closure) override; | 41 void SetConnectionLostClosure(const base::Closure& closure) override; |
43 int AddConnectionFilter(std::unique_ptr<ConnectionFilter> filter) override; | 42 int AddConnectionFilter(std::unique_ptr<ConnectionFilter> filter) override; |
44 void RemoveConnectionFilter(int filter_id) override; | 43 void RemoveConnectionFilter(int filter_id) override; |
45 void AddEmbeddedService(const std::string& name, | 44 void AddEmbeddedService(const std::string& name, |
46 const ServiceInfo& info) override; | 45 const ServiceInfo& info) override; |
47 void AddServiceRequestHandler( | 46 void AddServiceRequestHandler( |
48 const std::string& name, | 47 const std::string& name, |
49 const ServiceRequestHandler& handler) override; | 48 const ServiceRequestHandler& handler) override; |
50 int AddOnConnectHandler(const OnConnectHandler& handler) override; | 49 int AddOnConnectHandler(const OnConnectHandler& handler) override; |
51 void RemoveOnConnectHandler(int id) override; | 50 void RemoveOnConnectHandler(int id) override; |
52 | 51 |
53 void OnLocalServiceInfoAvailable( | 52 void OnLocalServiceInfoAvailable(const service_manager::Identity& identity); |
54 const service_manager::ServiceInfo& local_info); | |
55 void OnBrowserServiceInfoAvailable( | 53 void OnBrowserServiceInfoAvailable( |
56 const service_manager::ServiceInfo& browser_info); | 54 const service_manager::BindSourceInfo& browser_info); |
57 void OnConnectionLost(); | 55 void OnConnectionLost(); |
58 void GetInterface(service_manager::mojom::InterfaceProvider* provider, | 56 void GetInterface(service_manager::mojom::InterfaceProvider* provider, |
59 const std::string& interface_name, | 57 const std::string& interface_name, |
60 mojo::ScopedMessagePipeHandle request_handle); | 58 mojo::ScopedMessagePipeHandle request_handle); |
61 | 59 |
62 service_manager::ServiceInfo local_info_; | 60 service_manager::Identity identity_; |
63 service_manager::ServiceInfo browser_info_; | 61 service_manager::BindSourceInfo browser_info_; |
64 | 62 |
65 std::unique_ptr<service_manager::Connector> connector_; | 63 std::unique_ptr<service_manager::Connector> connector_; |
66 scoped_refptr<IOThreadContext> context_; | 64 scoped_refptr<IOThreadContext> context_; |
67 | 65 |
68 base::Closure connection_lost_handler_; | 66 base::Closure connection_lost_handler_; |
69 | 67 |
70 int next_on_connect_handler_id_ = 0; | 68 int next_on_connect_handler_id_ = 0; |
71 std::map<int, OnConnectHandler> on_connect_handlers_; | 69 std::map<int, OnConnectHandler> on_connect_handlers_; |
72 | 70 |
73 base::WeakPtrFactory<ServiceManagerConnectionImpl> weak_factory_; | 71 base::WeakPtrFactory<ServiceManagerConnectionImpl> weak_factory_; |
74 | 72 |
75 DISALLOW_COPY_AND_ASSIGN(ServiceManagerConnectionImpl); | 73 DISALLOW_COPY_AND_ASSIGN(ServiceManagerConnectionImpl); |
76 }; | 74 }; |
77 | 75 |
78 } // namespace content | 76 } // namespace content |
79 | 77 |
80 #endif // CONTENT_COMMON_SERVICE_MANAGER_SERVICE_MANAGER_CONNECTION_IMPL_H_ | 78 #endif // CONTENT_COMMON_SERVICE_MANAGER_SERVICE_MANAGER_CONNECTION_IMPL_H_ |
OLD | NEW |