Chromium Code Reviews| Index: mojo/service_manager/service_manager.h |
| diff --git a/mojo/service_manager/service_manager.h b/mojo/service_manager/service_manager.h |
| index f2ee988960fec903c0be4634222373d19b49c3cb..d94caeaa746ad0a9fdd858613a89c2b45115be29 100644 |
| --- a/mojo/service_manager/service_manager.h |
| +++ b/mojo/service_manager/service_manager.h |
| @@ -22,6 +22,15 @@ namespace mojo { |
| class ServiceLoader; |
| +// Interface class for testing/debugging only. |
|
DaveMoore
2014/04/04 21:06:46
This should either be a nested class within Servic
cpu_(ooo_6.6-7.5)
2014/04/04 23:42:45
Done.
|
| +class ServiceInterceptor { |
| + public: |
| + virtual ~ServiceInterceptor() {} |
| + // Called when ServiceManager::Connect is called. |
| + virtual ScopedMessagePipeHandle OnConnectToClient( |
| + const GURL& url, ScopedMessagePipeHandle handle) = 0; |
| +}; |
| + |
| class MOJO_SERVICE_MANAGER_EXPORT ServiceManager { |
| public: |
| // API for testing. |
| @@ -58,6 +67,8 @@ class MOJO_SERVICE_MANAGER_EXPORT ServiceManager { |
| // Sets a Loader to be used for a specific url scheme. |
| // Does not take ownership of |loader|. |
| void SetLoaderForScheme(ServiceLoader* loader, const std::string& scheme); |
| + // Allows to interpose a debugger to service connections. |
| + void SetInterceptor(ServiceInterceptor* interceptor); |
| private: |
| class ServiceFactory; |
| @@ -77,6 +88,7 @@ class MOJO_SERVICE_MANAGER_EXPORT ServiceManager { |
| URLToLoaderMap url_to_loader_; |
| SchemeToLoaderMap scheme_to_loader_; |
| ServiceLoader* default_loader_; |
| + ServiceInterceptor* interceptor_; |
| URLToServiceFactoryMap url_to_service_factory_; |
| DISALLOW_COPY_AND_ASSIGN(ServiceManager); |