Index: mojo/shell/dynamic_application_loader.h |
diff --git a/mojo/shell/dynamic_application_loader.h b/mojo/shell/dynamic_application_loader.h |
index 36546e985ae453d65c298978da55e08e3e730347..364d63a915ec4fce737d39f54580dfa91d242e14 100644 |
--- a/mojo/shell/dynamic_application_loader.h |
+++ b/mojo/shell/dynamic_application_loader.h |
@@ -22,11 +22,29 @@ namespace shell { |
class Context; |
class DynamicServiceRunnerFactory; |
class DynamicServiceRunner; |
+class Loader; |
+ |
+namespace internal { |
+ |
+// Please do not use, this is an implementation detail. |
darin (slow to review)
2014/08/27 06:34:19
it would be possible to hide this by moving most o
|
+class LoaderDelegate { |
+ public: |
+ virtual void LoaderComplete(Loader* loader) = 0; |
+ virtual scoped_ptr<DynamicServiceRunner> CreateRunner() = 0; |
+ virtual void CreateURLLoader(InterfaceRequest<URLLoader> loader_request) = 0; |
+ virtual const GURL& GetContentHandlerURL(const std::string& mime_type) = 0; |
+ virtual base::SequencedWorkerPool* GetBlockingPool() = 0; |
+ virtual ~LoaderDelegate() { |
darin (slow to review)
2014/08/27 06:34:19
nit: list dtor first as that's pretty canonical.
Aaron Boodman
2014/08/27 18:26:13
irrelevant in latest patch.
|
+ } |
+}; |
+ |
+} // namespace internal |
// An implementation of ApplicationLoader that retrieves a dynamic library |
// containing the implementation of the service and loads/runs it (via a |
// DynamicServiceRunner). |
-class DynamicApplicationLoader : public ApplicationLoader { |
+class DynamicApplicationLoader : public ApplicationLoader, |
+ public internal::LoaderDelegate { |
public: |
DynamicApplicationLoader( |
Context* context, |
@@ -46,26 +64,20 @@ class DynamicApplicationLoader : public ApplicationLoader { |
private: |
typedef std::map<std::string, GURL> MimeTypeToURLMap; |
- void LoadLocalService(const GURL& resolved_url, |
- scoped_refptr<LoadCallbacks> callbacks); |
- void LoadNetworkService(const GURL& resolved_url, |
- scoped_refptr<LoadCallbacks> callbacks); |
- void OnLoadNetworkServiceComplete(scoped_refptr<LoadCallbacks> callbacks, |
- URLResponsePtr url_response); |
- void RunLibrary(const base::FilePath& response_file, |
- scoped_refptr<LoadCallbacks> callbacks, |
- bool delete_file_after, |
- bool response_path_exists); |
- void OnRunLibraryComplete(DynamicServiceRunner* runner, |
- const base::FilePath& temp_file); |
+ // LoaderDelegate methods: |
+ virtual void LoaderComplete(Loader* loader) OVERRIDE; |
+ virtual scoped_ptr<DynamicServiceRunner> CreateRunner() OVERRIDE; |
+ virtual void CreateURLLoader( |
+ InterfaceRequest<URLLoader> loader_request) OVERRIDE; |
+ virtual const GURL& GetContentHandlerURL( |
+ const std::string& mime_type) OVERRIDE; |
+ virtual base::SequencedWorkerPool* GetBlockingPool() OVERRIDE; |
Context* const context_; |
scoped_ptr<DynamicServiceRunnerFactory> runner_factory_; |
- ScopedVector<DynamicServiceRunner> runners_; |
NetworkServicePtr network_service_; |
- URLLoaderPtr url_loader_; |
MimeTypeToURLMap mime_type_to_url_; |
- base::WeakPtrFactory<DynamicApplicationLoader> weak_ptr_factory_; |
+ ScopedVector<Loader> loaders_; |
DISALLOW_COPY_AND_ASSIGN(DynamicApplicationLoader); |
}; |