Index: mojo/shell/service_manager.h |
diff --git a/mojo/shell/service_manager.h b/mojo/shell/service_manager.h |
index 09cb8de11fc341df8af355cfa2556ce922f3b052..650b5f31f02a5caf1c6e34941985f08a0c567d5c 100644 |
--- a/mojo/shell/service_manager.h |
+++ b/mojo/shell/service_manager.h |
@@ -14,33 +14,35 @@ |
namespace mojo { |
namespace shell { |
-class Context; |
- |
class ServiceManager { |
public: |
+ // Interface to allowing default loading behavior to be overridden for a |
+ // specific url. |
class Loader { |
public: |
virtual ~Loader(); |
virtual void Load(const GURL& url, |
- ServiceManager* manager, |
ScopedMessagePipeHandle service_handle) = 0; |
protected: |
Loader(); |
}; |
- explicit ServiceManager(Context* context); |
+ ServiceManager(); |
~ServiceManager(); |
+ // Sets the default Loader to be used if not overridden by SetLoaderForURL(). |
+ void set_default_loader(Loader* loader) { default_loader_ = loader; } |
viettrungluu
2014/01/03 17:44:49
Who owns the default loader? (Someone else.)
And w
DaveMoore
2014/01/03 18:05:49
I thought it would be cleaner to have the Loaders
viettrungluu
2014/01/03 18:23:14
I don't feel strongly, but then you should probabl
|
+ // Sets a Loader to be used for a specific url. |
void SetLoaderForURL(Loader* loader, const GURL& gurl); |
+ // Returns the Loader to use for a url (using default if not overridden.) |
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 Service; |
- class DynamicLoader; |
- Context* context_; |
- scoped_ptr<Loader> default_loader_; |
+ Loader* default_loader_; |
typedef std::map<GURL, Service*> ServiceMap; |
ServiceMap url_to_service_; |
typedef std::map<GURL, Loader*> LoaderMap; |