| 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..18fbe012bc39ed13ff1020fa25204f99f281ab41 100644
|
| --- a/mojo/shell/dynamic_application_loader.h
|
| +++ b/mojo/shell/dynamic_application_loader.h
|
| @@ -23,10 +23,27 @@ class Context;
|
| class DynamicServiceRunnerFactory;
|
| class DynamicServiceRunner;
|
|
|
| +namespace {
|
| +class Loader;
|
| +
|
| +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() {
|
| + }
|
| +};
|
| +
|
| +} // namespace
|
| +
|
| // 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 LoaderDelegate {
|
| public:
|
| DynamicApplicationLoader(
|
| Context* context,
|
| @@ -46,26 +63,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);
|
| };
|
|
|