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 SERVICES_SERVICE_MANAGER_PUBLIC_CPP_LIB_CONNECTOR_IMPL_H_ | 5 #ifndef SERVICES_SERVICE_MANAGER_PUBLIC_CPP_LIB_CONNECTOR_IMPL_H_ |
6 #define SERVICES_SERVICE_MANAGER_PUBLIC_CPP_LIB_CONNECTOR_IMPL_H_ | 6 #define SERVICES_SERVICE_MANAGER_PUBLIC_CPP_LIB_CONNECTOR_IMPL_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
11 #include "base/threading/thread_checker.h" | 11 #include "base/threading/thread_checker.h" |
12 #include "services/service_manager/public/cpp/connector.h" | 12 #include "services/service_manager/public/cpp/connector.h" |
13 #include "services/service_manager/public/interfaces/connector.mojom.h" | 13 #include "services/service_manager/public/interfaces/connector.mojom.h" |
14 | 14 |
15 namespace service_manager { | 15 namespace service_manager { |
16 | 16 |
17 class ConnectorImpl : public Connector { | 17 class ConnectorImpl : public Connector { |
18 public: | 18 public: |
19 explicit ConnectorImpl(mojom::ConnectorPtrInfo unbound_state); | 19 explicit ConnectorImpl(mojom::ConnectorPtrInfo unbound_state); |
20 explicit ConnectorImpl(mojom::ConnectorPtr connector); | 20 explicit ConnectorImpl(mojom::ConnectorPtr connector); |
21 ~ConnectorImpl() override; | 21 ~ConnectorImpl() override; |
22 | 22 |
23 private: | 23 private: |
24 void OnConnectionError(); | 24 void OnConnectionError(); |
25 | 25 |
26 // Connector: | 26 // Connector: |
| 27 void Start(const Identity& identity, |
| 28 mojom::ServicePtr service, |
| 29 mojom::PIDReceiverRequest pid_receiver_request) override; |
27 std::unique_ptr<Connection> Connect(const std::string& name) override; | 30 std::unique_ptr<Connection> Connect(const std::string& name) override; |
28 std::unique_ptr<Connection> Connect(ConnectParams* params) override; | 31 std::unique_ptr<Connection> Connect(const Identity& target) override; |
29 std::unique_ptr<Connector> Clone() override; | 32 std::unique_ptr<Connector> Clone() override; |
30 void BindRequest(mojom::ConnectorRequest request) override; | 33 void BindRequest(mojom::ConnectorRequest request) override; |
31 | 34 |
32 bool BindIfNecessary(); | 35 bool BindIfNecessary(); |
33 | 36 |
34 mojom::ConnectorPtrInfo unbound_state_; | 37 mojom::ConnectorPtrInfo unbound_state_; |
35 mojom::ConnectorPtr connector_; | 38 mojom::ConnectorPtr connector_; |
36 | 39 |
37 base::ThreadChecker thread_checker_; | 40 base::ThreadChecker thread_checker_; |
38 | 41 |
39 DISALLOW_COPY_AND_ASSIGN(ConnectorImpl); | 42 DISALLOW_COPY_AND_ASSIGN(ConnectorImpl); |
40 }; | 43 }; |
41 | 44 |
42 } // namespace service_manager | 45 } // namespace service_manager |
43 | 46 |
44 #endif // SERVICES_SERVICE_MANAGER_PUBLIC_CPP_LIB_CONNECTOR_IMPL_H_ | 47 #endif // SERVICES_SERVICE_MANAGER_PUBLIC_CPP_LIB_CONNECTOR_IMPL_H_ |
OLD | NEW |