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 18 matching lines...) Expand all Loading... |
29 explicit ServiceManagerConnectionImpl( | 29 explicit ServiceManagerConnectionImpl( |
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 void SetInitializeHandler(const base::Closure& handler) override; | |
40 service_manager::Connector* GetConnector() override; | 39 service_manager::Connector* GetConnector() override; |
41 const service_manager::Identity& GetIdentity() const override; | 40 const service_manager::Identity& GetIdentity() const override; |
42 void SetConnectionLostClosure(const base::Closure& closure) override; | 41 void SetConnectionLostClosure(const base::Closure& closure) override; |
43 void SetupInterfaceRequestProxies( | 42 void SetupInterfaceRequestProxies( |
44 service_manager::InterfaceRegistry* registry, | 43 service_manager::InterfaceRegistry* registry, |
45 service_manager::InterfaceProvider* provider) override; | 44 service_manager::InterfaceProvider* provider) override; |
46 int AddConnectionFilter(std::unique_ptr<ConnectionFilter> filter) override; | 45 int AddConnectionFilter(std::unique_ptr<ConnectionFilter> filter) override; |
47 void RemoveConnectionFilter(int filter_id) override; | 46 void RemoveConnectionFilter(int filter_id) override; |
48 void AddEmbeddedService(const std::string& name, | 47 void AddEmbeddedService(const std::string& name, |
49 const ServiceInfo& info) override; | 48 const ServiceInfo& info) override; |
(...skipping 13 matching lines...) Expand all Loading... |
63 const std::string& interface_name, | 62 const std::string& interface_name, |
64 mojo::ScopedMessagePipeHandle request_handle); | 63 mojo::ScopedMessagePipeHandle request_handle); |
65 | 64 |
66 service_manager::Identity identity_; | 65 service_manager::Identity identity_; |
67 service_manager::ServiceInfo local_info_; | 66 service_manager::ServiceInfo local_info_; |
68 service_manager::ServiceInfo last_remote_info_; | 67 service_manager::ServiceInfo last_remote_info_; |
69 | 68 |
70 std::unique_ptr<service_manager::Connector> connector_; | 69 std::unique_ptr<service_manager::Connector> connector_; |
71 scoped_refptr<IOThreadContext> context_; | 70 scoped_refptr<IOThreadContext> context_; |
72 | 71 |
73 base::Closure initialize_handler_; | |
74 base::Closure connection_lost_handler_; | 72 base::Closure connection_lost_handler_; |
75 | 73 |
76 std::unordered_map<std::string, std::unique_ptr<EmbeddedServiceRunner>> | 74 std::unordered_map<std::string, std::unique_ptr<EmbeddedServiceRunner>> |
77 embedded_services_; | 75 embedded_services_; |
78 std::unordered_map<std::string, ServiceRequestHandler> request_handlers_; | 76 std::unordered_map<std::string, ServiceRequestHandler> request_handlers_; |
79 int next_on_connect_handler_id_ = 0; | 77 int next_on_connect_handler_id_ = 0; |
80 std::map<int, OnConnectHandler> on_connect_handlers_; | 78 std::map<int, OnConnectHandler> on_connect_handlers_; |
81 | 79 |
82 base::WeakPtrFactory<ServiceManagerConnectionImpl> weak_factory_; | 80 base::WeakPtrFactory<ServiceManagerConnectionImpl> weak_factory_; |
83 | 81 |
84 DISALLOW_COPY_AND_ASSIGN(ServiceManagerConnectionImpl); | 82 DISALLOW_COPY_AND_ASSIGN(ServiceManagerConnectionImpl); |
85 }; | 83 }; |
86 | 84 |
87 } // namespace content | 85 } // namespace content |
88 | 86 |
89 #endif // CONTENT_COMMON_SERVICE_MANAGER_SERVICE_MANAGER_CONNECTION_IMPL_H_ | 87 #endif // CONTENT_COMMON_SERVICE_MANAGER_SERVICE_MANAGER_CONNECTION_IMPL_H_ |
OLD | NEW |