OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_CONNECT_PARAMS_H_ | 5 #ifndef SERVICES_SERVICE_MANAGER_CONNECT_PARAMS_H_ |
6 #define SERVICES_SERVICE_MANAGER_CONNECT_PARAMS_H_ | 6 #define SERVICES_SERVICE_MANAGER_CONNECT_PARAMS_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 bool HasClientProcessInfo() const { | 45 bool HasClientProcessInfo() const { |
46 return service_.is_bound() && pid_receiver_request_.is_pending(); | 46 return service_.is_bound() && pid_receiver_request_.is_pending(); |
47 } | 47 } |
48 mojom::ServicePtr TakeService() { | 48 mojom::ServicePtr TakeService() { |
49 return std::move(service_); | 49 return std::move(service_); |
50 } | 50 } |
51 mojom::PIDReceiverRequest TakePIDReceiverRequest() { | 51 mojom::PIDReceiverRequest TakePIDReceiverRequest() { |
52 return std::move(pid_receiver_request_); | 52 return std::move(pid_receiver_request_); |
53 } | 53 } |
54 | 54 |
| 55 void set_interface_request_info( |
| 56 const std::string& interface_name, |
| 57 mojo::ScopedMessagePipeHandle interface_pipe) { |
| 58 interface_name_ = interface_name; |
| 59 interface_pipe_ = std::move(interface_pipe); |
| 60 } |
| 61 const std::string& interface_name() const { |
| 62 return interface_name_; |
| 63 } |
| 64 bool HasInterfaceRequestInfo() const { |
| 65 return !interface_name_.empty() && interface_pipe_.is_valid(); |
| 66 } |
| 67 mojo::ScopedMessagePipeHandle TakeInterfaceRequestPipe() { |
| 68 return std::move(interface_pipe_); |
| 69 } |
| 70 |
55 void set_connect_callback(const mojom::Connector::ConnectCallback& value) { | 71 void set_connect_callback(const mojom::Connector::ConnectCallback& value) { |
56 connect_callback_ = value; | 72 connect_callback_ = value; |
57 } | 73 } |
58 const mojom::Connector::ConnectCallback& connect_callback() const { | 74 const mojom::Connector::ConnectCallback& connect_callback() const { |
59 return connect_callback_; | 75 return connect_callback_; |
60 } | 76 } |
61 | 77 |
| 78 void set_bind_interface_callback( |
| 79 const mojom::Connector::BindInterfaceCallback& callback) { |
| 80 bind_interface_callback_ = callback; |
| 81 } |
| 82 const mojom::Connector::BindInterfaceCallback& |
| 83 bind_interface_callback() const { |
| 84 return bind_interface_callback_; |
| 85 } |
| 86 |
62 private: | 87 private: |
63 // It may be null (i.e., is_null() returns true) which indicates that there is | 88 // It may be null (i.e., is_null() returns true) which indicates that there is |
64 // no source (e.g., for the first application or in tests). | 89 // no source (e.g., for the first application or in tests). |
65 Identity source_; | 90 Identity source_; |
66 // The identity of the application being connected to. | 91 // The identity of the application being connected to. |
67 Identity target_; | 92 Identity target_; |
68 | 93 |
69 mojom::InterfaceProviderRequest remote_interfaces_; | 94 mojom::InterfaceProviderRequest remote_interfaces_; |
70 mojom::ServicePtr service_; | 95 mojom::ServicePtr service_; |
71 mojom::PIDReceiverRequest pid_receiver_request_; | 96 mojom::PIDReceiverRequest pid_receiver_request_; |
| 97 std::string interface_name_; |
| 98 mojo::ScopedMessagePipeHandle interface_pipe_; |
72 mojom::Connector::ConnectCallback connect_callback_; | 99 mojom::Connector::ConnectCallback connect_callback_; |
| 100 mojom::Connector::BindInterfaceCallback bind_interface_callback_; |
73 | 101 |
74 DISALLOW_COPY_AND_ASSIGN(ConnectParams); | 102 DISALLOW_COPY_AND_ASSIGN(ConnectParams); |
75 }; | 103 }; |
76 | 104 |
77 } // namespace service_manager | 105 } // namespace service_manager |
78 | 106 |
79 #endif // SERVICES_SERVICE_MANAGER_CONNECT_PARAMS_H_ | 107 #endif // SERVICES_SERVICE_MANAGER_CONNECT_PARAMS_H_ |
OLD | NEW |