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> |
11 #include <set> | 11 #include <set> |
12 #include <utility> | 12 #include <utility> |
13 | 13 |
14 #include "base/callback.h" | 14 #include "base/callback.h" |
15 #include "base/memory/ptr_util.h" | 15 #include "base/memory/ptr_util.h" |
16 #include "mojo/public/cpp/bindings/binding.h" | 16 #include "mojo/public/cpp/bindings/binding.h" |
17 #include "services/service_manager/public/cpp/identity.h" | 17 #include "services/service_manager/public/cpp/identity.h" |
18 #include "services/service_manager/public/cpp/interface_provider_spec.h" | 18 #include "services/service_manager/public/cpp/interface_provider_spec.h" |
19 #include "services/service_manager/public/cpp/lib/callback_binder.h" | 19 #include "services/service_manager/public/cpp/lib/callback_binder.h" |
20 #include "services/service_manager/public/cpp/lib/interface_factory_binder.h" | 20 #include "services/service_manager/public/cpp/lib/interface_factory_binder.h" |
21 #include "services/service_manager/public/interfaces/interface_provider.mojom.h" | 21 #include "services/service_manager/public/interfaces/interface_provider.mojom.h" |
22 | 22 |
23 namespace service_manager { | 23 namespace service_manager { |
24 class Connection; | 24 class Connection; |
25 class InterfaceBinder; | 25 class InterfaceBinder; |
26 | 26 |
| 27 // Returns the set of capabilities required from the target. |
| 28 CapabilitySet GetRequestedCapabilities(const InterfaceProviderSpec& source_spec, |
| 29 const Identity& target); |
| 30 |
| 31 // Generates a single set of interfaces that is the union of all interfaces |
| 32 // exposed by the target for the capabilities requested by the source. |
| 33 InterfaceSet GetInterfacesToExpose(const InterfaceProviderSpec& source_spec, |
| 34 const Identity& target, |
| 35 const InterfaceProviderSpec& target_spec); |
| 36 |
27 // An implementation of mojom::InterfaceProvider that allows the user to | 37 // An implementation of mojom::InterfaceProvider that allows the user to |
28 // register services to be exposed to another application. | 38 // register services to be exposed to another application. |
29 // | 39 // |
30 // To use, define a class that implements your specific interface. Then | 40 // To use, define a class that implements your specific interface. Then |
31 // implement an InterfaceFactory<Foo> that binds instances of FooImpl to | 41 // implement an InterfaceFactory<Foo> that binds instances of FooImpl to |
32 // InterfaceRequest<Foo>s and register that on the registry like this: | 42 // InterfaceRequest<Foo>s and register that on the registry like this: |
33 // | 43 // |
34 // registry.AddInterface(&factory); | 44 // registry.AddInterface(&factory); |
35 // | 45 // |
36 // Or, if you have multiple factories implemented by the same type, explicitly | 46 // Or, if you have multiple factories implemented by the same type, explicitly |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
217 std::list<base::Closure> connection_lost_closures_; | 227 std::list<base::Closure> connection_lost_closures_; |
218 | 228 |
219 base::WeakPtrFactory<InterfaceRegistry> weak_factory_; | 229 base::WeakPtrFactory<InterfaceRegistry> weak_factory_; |
220 | 230 |
221 DISALLOW_COPY_AND_ASSIGN(InterfaceRegistry); | 231 DISALLOW_COPY_AND_ASSIGN(InterfaceRegistry); |
222 }; | 232 }; |
223 | 233 |
224 } // namespace service_manager | 234 } // namespace service_manager |
225 | 235 |
226 #endif // SERVICES_SERVICE_MANAGER_PUBLIC_CPP_INTERFACE_REGISTRY_H_ | 236 #endif // SERVICES_SERVICE_MANAGER_PUBLIC_CPP_INTERFACE_REGISTRY_H_ |
OLD | NEW |