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..6d9ab5de0d821673e530d060a12b5571ae00ca1a 100644 |
--- a/mojo/service_manager/service_manager.h |
+++ b/mojo/service_manager/service_manager.h |
@@ -39,6 +39,15 @@ class MOJO_SERVICE_MANAGER_EXPORT ServiceManager { |
ServiceManager* manager_; |
}; |
+ // Interface class for debugging only. |
+ class Interceptor { |
+ public: |
+ virtual ~Interceptor() {} |
+ // Called when ServiceManager::Connect is called. |
+ virtual ScopedMessagePipeHandle OnConnectToClient( |
+ const GURL& url, ScopedMessagePipeHandle handle) = 0; |
+ }; |
+ |
ServiceManager(); |
~ServiceManager(); |
@@ -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(Interceptor* 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_; |
+ Interceptor* interceptor_; |
URLToServiceFactoryMap url_to_service_factory_; |
DISALLOW_COPY_AND_ASSIGN(ServiceManager); |