Index: mojo/shell/service_connector.h |
diff --git a/mojo/shell/service_connector.h b/mojo/shell/service_connector.h |
index 725b11921797f3f50f21fbd1ff39be4ed0be6afd..6b338b640da221cd763c5536871b8e807081a8d5 100644 |
--- a/mojo/shell/service_connector.h |
+++ b/mojo/shell/service_connector.h |
@@ -28,6 +28,17 @@ class ServiceConnector { |
Loader(); |
}; |
+ // API for testing. |
+ class TestAPI { |
+ private: |
+ friend class ServiceConnectorTest; |
+ explicit TestAPI(ServiceConnector* connector) : connector_(connector) {} |
+ // Returns true if there is a ServiceFactory for this URL. |
+ bool HasFactoryForURL(const GURL& url) const; |
+ |
+ ServiceConnector* connector_; |
+ }; |
+ |
ServiceConnector(); |
~ServiceConnector(); |
@@ -41,10 +52,12 @@ class ServiceConnector { |
Loader* GetLoaderForURL(const GURL& gurl); |
// Loads a service if necessary and establishes a new client connection. |
void Connect(const GURL& url, ScopedMessagePipeHandle client_handle); |
- |
private: |
class ServiceFactory; |
+ // Removes a ServiceFactory when it no longer has any connections. |
+ void RemoveServiceFactory(ServiceFactory* service_factory); |
+ |
Loader* default_loader_; |
typedef std::map<GURL, ServiceFactory*> ServiceFactoryMap; |
ServiceFactoryMap url_to_service_factory_; |