Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef MOJO_PUBLIC_CPP_APPLICATION_LIB_SERVICE_REGISTRY_H_ | |
| 6 #define MOJO_PUBLIC_CPP_APPLICATION_LIB_SERVICE_REGISTRY_H_ | |
| 7 | |
| 8 #include "mojo/public/interfaces/service_provider/service_provider.mojom.h" | |
| 9 | |
| 10 namespace mojo { | |
| 11 | |
| 12 class Application; | |
| 13 | |
| 14 namespace internal { | |
| 15 | |
| 16 class ServiceConnectorBase; | |
| 17 | |
| 18 class ServiceRegistry : public ServiceProvider { | |
|
darin (slow to review)
2014/06/12 16:11:51
since the ServiceRegistry is a ServiceProvider and
DaveMoore
2014/06/12 16:28:14
Done.
| |
| 19 public: | |
| 20 ServiceRegistry(Application* application); | |
| 21 ServiceRegistry(Application* application, | |
| 22 ScopedMessagePipeHandle service_provider_handle); | |
| 23 virtual ~ServiceRegistry(); | |
| 24 | |
| 25 void AddServiceConnector(ServiceConnectorBase* service_connector); | |
| 26 void RemoveServiceConnector(ServiceConnectorBase* service_connector); | |
| 27 | |
| 28 ServiceProvider* service_provider() { return service_provider_.get(); } | |
| 29 void BindServiceProvider(ScopedMessagePipeHandle service_provider_handle); | |
| 30 | |
| 31 // ServiceProvider method. | |
| 32 virtual void ConnectToService(const mojo::String& service_url, | |
| 33 const mojo::String& service_name, | |
| 34 ScopedMessagePipeHandle client_handle, | |
| 35 const mojo::String& requestor_url) | |
| 36 MOJO_OVERRIDE; | |
| 37 | |
| 38 private: | |
| 39 Application* application_; | |
| 40 typedef std::map<std::string, ServiceConnectorBase*> | |
| 41 NameToServiceConnectorMap; | |
| 42 NameToServiceConnectorMap name_to_service_connector_; | |
| 43 ServiceProviderPtr service_provider_; | |
| 44 | |
| 45 MOJO_DISALLOW_COPY_AND_ASSIGN(ServiceRegistry); | |
| 46 }; | |
| 47 | |
| 48 } // namespace internal | |
| 49 } // namespace mojo | |
| 50 | |
| 51 #endif // MOJO_PUBLIC_CPP_APPLICATION_LIB_SERVICE_REGISTRY_H_ | |
| OLD | NEW |