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

Unified Diff: mojo/service_manager/service_manager.h

Issue 423963004: First cut at "content handling" support in Mojo. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed Dave's comments, plus added a --content-handlers switch 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/service_manager/service_manager.h
diff --git a/mojo/service_manager/service_manager.h b/mojo/service_manager/service_manager.h
index 8809e86715386a84b560d67371f53a5c905f3b16..6ec2ff3e1b91bfc4ed6b9aeac2126a0cdcb3a1c8 100644
--- a/mojo/service_manager/service_manager.h
+++ b/mojo/service_manager/service_manager.h
@@ -10,6 +10,7 @@
#include "base/basictypes.h"
#include "base/gtest_prod_util.h"
#include "base/memory/scoped_ptr.h"
+#include "base/memory/weak_ptr.h"
#include "mojo/public/interfaces/service_provider/service_provider.mojom.h"
#include "mojo/service_manager/service_loader.h"
#include "mojo/service_manager/service_manager_export.h"
@@ -87,10 +88,30 @@ class MOJO_SERVICE_MANAGER_EXPORT ServiceManager {
void TerminateShellConnections();
private:
+ struct ContentHandlerConnection;
+ class LoadServiceCallbacksImpl;
class ShellImpl;
+
typedef std::map<std::string, ServiceLoader*> SchemeToLoaderMap;
typedef std::map<GURL, ServiceLoader*> URLToLoaderMap;
typedef std::map<GURL, ShellImpl*> URLToShellImplMap;
+ typedef std::map<GURL, ContentHandlerConnection*> URLToContentHandlerMap;
+
+ void ConnectToClient(ShellImpl* shell_impl,
+ const GURL& url,
+ const GURL& requestor_url,
+ ServiceProviderPtr service_provider);
+
+ void RegisterLoadedApplication(const GURL& service_url,
+ const GURL& requestor_url,
+ ServiceProviderPtr service_provider,
+ ScopedMessagePipeHandle* shell_handle);
+
+ void LoadWithContentHandler(const GURL& content_url,
+ const GURL& requestor_url,
+ const GURL& content_handler_url,
+ URLResponsePtr content,
+ ServiceProviderPtr service_provider);
// Returns the Loader to use for a url (using default if not overridden.)
// The preference is to use a loader that's been specified for an url first,
@@ -107,6 +128,9 @@ class MOJO_SERVICE_MANAGER_EXPORT ServiceManager {
Interceptor* interceptor_;
URLToShellImplMap url_to_shell_impl_;
+ URLToContentHandlerMap url_to_content_handler_;
+
+ base::WeakPtrFactory<ServiceManager> weak_ptr_factory_;
DISALLOW_COPY_AND_ASSIGN(ServiceManager);
};

Powered by Google App Engine
This is Rietveld 408576698