| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_SERVICE_MANAGER_SERVICE_MANAGER_H_ | 5 #ifndef MOJO_SERVICE_MANAGER_SERVICE_MANAGER_H_ |
| 6 #define MOJO_SERVICE_MANAGER_SERVICE_MANAGER_H_ | 6 #define MOJO_SERVICE_MANAGER_SERVICE_MANAGER_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 const GURL& url, ScopedMessagePipeHandle handle) = 0; | 51 const GURL& url, ScopedMessagePipeHandle handle) = 0; |
| 52 }; | 52 }; |
| 53 | 53 |
| 54 ServiceManager(); | 54 ServiceManager(); |
| 55 ~ServiceManager(); | 55 ~ServiceManager(); |
| 56 | 56 |
| 57 // Returns a shared instance, creating it if necessary. | 57 // Returns a shared instance, creating it if necessary. |
| 58 static ServiceManager* GetInstance(); | 58 static ServiceManager* GetInstance(); |
| 59 | 59 |
| 60 // Loads a service if necessary and establishes a new client connection. | 60 // Loads a service if necessary and establishes a new client connection. |
| 61 void ConnectToService(const GURL& url, ScopedMessagePipeHandle client_handle); | 61 void ConnectToService(const GURL& url, |
| 62 const std::string& name, |
| 63 ScopedMessagePipeHandle client_handle); |
| 62 | 64 |
| 63 // Sets the default Loader to be used if not overridden by SetLoaderForURL() | 65 // Sets the default Loader to be used if not overridden by SetLoaderForURL() |
| 64 // or SetLoaderForScheme(). | 66 // or SetLoaderForScheme(). |
| 65 void set_default_loader(scoped_ptr<ServiceLoader> loader) { | 67 void set_default_loader(scoped_ptr<ServiceLoader> loader) { |
| 66 default_loader_ = loader.Pass(); | 68 default_loader_ = loader.Pass(); |
| 67 } | 69 } |
| 68 // Sets a Loader to be used for a specific url. | 70 // Sets a Loader to be used for a specific url. |
| 69 void SetLoaderForURL(scoped_ptr<ServiceLoader> loader, const GURL& url); | 71 void SetLoaderForURL(scoped_ptr<ServiceLoader> loader, const GURL& url); |
| 70 // Sets a Loader to be used for a specific url scheme. | 72 // Sets a Loader to be used for a specific url scheme. |
| 71 void SetLoaderForScheme(scoped_ptr<ServiceLoader> loader, | 73 void SetLoaderForScheme(scoped_ptr<ServiceLoader> loader, |
| (...skipping 21 matching lines...) Expand all Loading... |
| 93 scoped_ptr<ServiceLoader> default_loader_; | 95 scoped_ptr<ServiceLoader> default_loader_; |
| 94 Interceptor* interceptor_; | 96 Interceptor* interceptor_; |
| 95 | 97 |
| 96 URLToServiceFactoryMap url_to_service_factory_; | 98 URLToServiceFactoryMap url_to_service_factory_; |
| 97 DISALLOW_COPY_AND_ASSIGN(ServiceManager); | 99 DISALLOW_COPY_AND_ASSIGN(ServiceManager); |
| 98 }; | 100 }; |
| 99 | 101 |
| 100 } // namespace mojo | 102 } // namespace mojo |
| 101 | 103 |
| 102 #endif // MOJO_SERVICE_MANAGER_SERVICE_MANAGER_H_ | 104 #endif // MOJO_SERVICE_MANAGER_SERVICE_MANAGER_H_ |
| OLD | NEW |