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_INTERFACE_REGISTRY_H_ | 5 #ifndef SERVICES_SERVICE_MANAGER_PUBLIC_CPP_INTERFACE_REGISTRY_H_ |
6 #define SERVICES_SERVICE_MANAGER_PUBLIC_CPP_INTERFACE_REGISTRY_H_ | 6 #define SERVICES_SERVICE_MANAGER_PUBLIC_CPP_INTERFACE_REGISTRY_H_ |
7 | 7 |
8 #include <list> | 8 #include <list> |
9 #include <memory> | 9 #include <memory> |
10 #include <queue> | 10 #include <queue> |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 void ResumeBinding(); | 158 void ResumeBinding(); |
159 | 159 |
160 // Populates a set with the interface names this registry can bind. | 160 // Populates a set with the interface names this registry can bind. |
161 void GetInterfaceNames(std::set<std::string>* interface_names); | 161 void GetInterfaceNames(std::set<std::string>* interface_names); |
162 | 162 |
163 // Sets a closure to be run when the InterfaceProvider pipe is closed. Note | 163 // Sets a closure to be run when the InterfaceProvider pipe is closed. Note |
164 // that by the time any added closure is invoked, the InterfaceRegistry may | 164 // that by the time any added closure is invoked, the InterfaceRegistry may |
165 // have been deleted. | 165 // have been deleted. |
166 void AddConnectionLostClosure(const base::Closure& connection_lost_closure); | 166 void AddConnectionLostClosure(const base::Closure& connection_lost_closure); |
167 | 167 |
| 168 // Binds a local interface request. |
| 169 void BindInterface(const std::string& name, |
| 170 mojo::ScopedMessagePipeHandle handle); |
| 171 |
168 private: | 172 private: |
169 using InterfaceNameToBinderMap = | 173 using InterfaceNameToBinderMap = |
170 std::map<std::string, std::unique_ptr<InterfaceBinder>>; | 174 std::map<std::string, std::unique_ptr<InterfaceBinder>>; |
171 | 175 |
172 // mojom::InterfaceProvider: | 176 // mojom::InterfaceProvider: |
173 void GetInterface(const std::string& interface_name, | 177 void GetInterface(const std::string& interface_name, |
174 mojo::ScopedMessagePipeHandle handle) override; | 178 mojo::ScopedMessagePipeHandle handle) override; |
175 | 179 |
176 // Returns true if the binder was set, false if it was not set (e.g. by | 180 // Returns true if the binder was set, false if it was not set (e.g. by |
177 // some filtering policy preventing this interface from being exposed). | 181 // some filtering policy preventing this interface from being exposed). |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
227 std::list<base::Closure> connection_lost_closures_; | 231 std::list<base::Closure> connection_lost_closures_; |
228 | 232 |
229 base::WeakPtrFactory<InterfaceRegistry> weak_factory_; | 233 base::WeakPtrFactory<InterfaceRegistry> weak_factory_; |
230 | 234 |
231 DISALLOW_COPY_AND_ASSIGN(InterfaceRegistry); | 235 DISALLOW_COPY_AND_ASSIGN(InterfaceRegistry); |
232 }; | 236 }; |
233 | 237 |
234 } // namespace service_manager | 238 } // namespace service_manager |
235 | 239 |
236 #endif // SERVICES_SERVICE_MANAGER_PUBLIC_CPP_INTERFACE_REGISTRY_H_ | 240 #endif // SERVICES_SERVICE_MANAGER_PUBLIC_CPP_INTERFACE_REGISTRY_H_ |
OLD | NEW |