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

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: more gn 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
« no previous file with comments | « mojo/shell/dbus_service_loader_linux.cc ('k') | mojo/shell/dynamic_service_loader.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..0db228471276195d54b80f0913c4eddf32d4c27a 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,36 @@ class DynamicServiceLoader : public ServiceLoader {
scoped_ptr<DynamicServiceRunnerFactory> runner_factory);
virtual ~DynamicServiceLoader();
+ void RegisterContentHandler(const std::string& mime_type,
+ const GURL& content_handler_url);
+
// ServiceLoader methods:
- virtual void LoadService(ServiceManager* manager,
- const GURL& url,
- ScopedMessagePipeHandle service_handle) OVERRIDE;
+ virtual void Load(ServiceManager* manager,
+ const GURL& url,
+ scoped_refptr<LoadCallbacks> 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<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);
+
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);
};
« no previous file with comments | « mojo/shell/dbus_service_loader_linux.cc ('k') | mojo/shell/dynamic_service_loader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698