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

Unified Diff: mojo/shell/dynamic_service_loader.h

Issue 423963004: First cut at "content handling" support in Mojo. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: blech 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_service_loader.h
diff --git a/mojo/shell/dynamic_service_loader.h b/mojo/shell/dynamic_service_loader.h
index 72bf093e56e093809a83cd8d3a934f904cf12bca..4c3445dff0d601217e9f73cecf1e176c81e786cc 100644
--- a/mojo/shell/dynamic_service_loader.h
+++ b/mojo/shell/dynamic_service_loader.h
@@ -8,6 +8,7 @@
#include <map>
#include "base/macros.h"
+#include "base/memory/weak_ptr.h"
#include "mojo/public/cpp/system/core.h"
#include "mojo/service_manager/service_loader.h"
#include "mojo/services/public/interfaces/network/network_service.mojom.h"
@@ -30,17 +31,38 @@ class DynamicServiceLoader : public ServiceLoader {
scoped_ptr<DynamicServiceRunnerFactory> runner_factory);
virtual ~DynamicServiceLoader();
+ void set_content_handler(const std::string& mime_type,
+ const GURL& content_handler_url);
DaveMoore 2014/08/06 20:50:46 SetContentHandlerURL() or SetContentHandlerURLForM
Aaron Boodman 2014/08/06 22:49:29 I looked at doing this, but it makes ownership of
+
// ServiceLoader methods:
- virtual void LoadService(ServiceManager* manager,
- const GURL& url,
- ScopedMessagePipeHandle service_handle) OVERRIDE;
+ virtual void LoadService(
+ ServiceManager* manager,
+ const GURL& url,
+ scoped_refptr<LoadServiceCallbacks> callbacks) OVERRIDE;
virtual void OnServiceError(ServiceManager* manager, const GURL& url)
OVERRIDE;
private:
+ typedef std::map<std::string, GURL> MimeTypeToURLMap;
+
+ void LoadLocalService(const GURL& resolved_url,
+ scoped_refptr<LoadServiceCallbacks> callbacks);
+ void LoadNetworkService(const GURL& resolved_url,
+ scoped_refptr<LoadServiceCallbacks> callbacks);
+ void OnLoadNetworkServiceComplete(
+ scoped_refptr<LoadServiceCallbacks> callbacks,
+ URLResponsePtr url_response);
+ void RunLibrary(const base::FilePath& response_file,
+ scoped_refptr<LoadServiceCallbacks> callbacks,
+ bool delete_file_after,
+ bool response_path_exists);
+
Context* const context_;
scoped_ptr<DynamicServiceRunnerFactory> runner_factory_;
NetworkServicePtr network_service_;
+ URLLoaderPtr url_loader_;
+ MimeTypeToURLMap mime_type_to_url_;
+ base::WeakPtrFactory<DynamicServiceLoader> weak_ptr_factory_;
DISALLOW_COPY_AND_ASSIGN(DynamicServiceLoader);
};

Powered by Google App Engine
This is Rietveld 408576698