| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 MOJO_PUBLIC_APPLICATION_SERVICE_PROVIDER_IMPL_H_ | 5 #ifndef MOJO_PUBLIC_APPLICATION_SERVICE_PROVIDER_IMPL_H_ |
| 6 #define MOJO_PUBLIC_APPLICATION_SERVICE_PROVIDER_IMPL_H_ | 6 #define MOJO_PUBLIC_APPLICATION_SERVICE_PROVIDER_IMPL_H_ |
| 7 | 7 |
| 8 #include <functional> | 8 #include <functional> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 // drop |interface_request| (as implied by the interface). | 28 // drop |interface_request| (as implied by the interface). |
| 29 template <typename Interface> | 29 template <typename Interface> |
| 30 using InterfaceRequestHandler = | 30 using InterfaceRequestHandler = |
| 31 std::function<void(const ConnectionContext& connection_context, | 31 std::function<void(const ConnectionContext& connection_context, |
| 32 InterfaceRequest<Interface> interface_request)>; | 32 InterfaceRequest<Interface> interface_request)>; |
| 33 | 33 |
| 34 // Constructs this service provider implementation in an unbound state. | 34 // Constructs this service provider implementation in an unbound state. |
| 35 ServiceProviderImpl(); | 35 ServiceProviderImpl(); |
| 36 | 36 |
| 37 // Constructs this service provider implementation, binding it to the given | 37 // Constructs this service provider implementation, binding it to the given |
| 38 // interface request. | 38 // interface request. Note: If |service_provider_request| is not valid |
| 39 // ("pending"), then the object will be put into an unbound state. |
| 39 explicit ServiceProviderImpl( | 40 explicit ServiceProviderImpl( |
| 40 const ConnectionContext& connection_context, | 41 const ConnectionContext& connection_context, |
| 41 InterfaceRequest<ServiceProvider> service_provider_request); | 42 InterfaceRequest<ServiceProvider> service_provider_request); |
| 42 | 43 |
| 43 ~ServiceProviderImpl() override; | 44 ~ServiceProviderImpl() override; |
| 44 | 45 |
| 45 // Binds this service provider implementation to the given interface request. | 46 // Binds this service provider implementation to the given interface request. |
| 46 // This may only be called if this object is unbound. | 47 // This may only be called if this object is unbound. |
| 47 void Bind(const ConnectionContext& connection_context, | 48 void Bind(const ConnectionContext& connection_context, |
| 48 InterfaceRequest<ServiceProvider> service_provider_request); | 49 InterfaceRequest<ServiceProvider> service_provider_request); |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 | 146 |
| 146 internal::ServiceConnectorRegistry service_connector_registry_; | 147 internal::ServiceConnectorRegistry service_connector_registry_; |
| 147 ServiceProvider* fallback_service_provider_; | 148 ServiceProvider* fallback_service_provider_; |
| 148 | 149 |
| 149 MOJO_DISALLOW_COPY_AND_ASSIGN(ServiceProviderImpl); | 150 MOJO_DISALLOW_COPY_AND_ASSIGN(ServiceProviderImpl); |
| 150 }; | 151 }; |
| 151 | 152 |
| 152 } // namespace mojo | 153 } // namespace mojo |
| 153 | 154 |
| 154 #endif // MOJO_PUBLIC_APPLICATION_SERVICE_PROVIDER_IMPL_H_ | 155 #endif // MOJO_PUBLIC_APPLICATION_SERVICE_PROVIDER_IMPL_H_ |
| OLD | NEW |