Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(413)

Unified Diff: mojo/shell/dynamic_application_loader.h

Issue 513573002: Mojo: Fix two bugs in content handling (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Darin comments, updates for Android toolchain Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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);
};

Powered by Google App Engine
This is Rietveld 408576698