Added anti-singleton services (new process/thread per connection).
TEST=`./out/Debug/mojo_shell --enable-multiprocess ./out/Debug/spinning_cube.pexe.mojo ./out/Debug/echo_client.pexe.mojo`
BUG=#396
R=viettrungluu@chromium.org
Review URL: https://codereview.chromium.org/1444433002 .
diff --git a/shell/application_manager/application_manager.h b/shell/application_manager/application_manager.h
index 0a5e8b0..3be4992 100644
--- a/shell/application_manager/application_manager.h
+++ b/shell/application_manager/application_manager.h
@@ -146,8 +146,8 @@
using SchemeToLoaderMap =
std::map<std::string, scoped_ptr<ApplicationLoader>>;
using IdentityToShellImplMap = std::map<Identity, scoped_ptr<ShellImpl>>;
- using URLToContentHandlerMap =
- std::map<GURL, scoped_ptr<ContentHandlerConnection>>;
+ using IdentityToContentHandlerMap =
+ std::map<Identity, scoped_ptr<ContentHandlerConnection>>;
using URLToArgsMap = std::map<GURL, std::vector<std::string>>;
using MimeTypeToURLMap = std::map<std::string, GURL>;
using URLToNativeOptionsMap = std::map<GURL, NativeApplicationOptions>;
@@ -175,6 +175,12 @@
const std::vector<std::string>& parameters,
ApplicationLoader* loader);
+ // Creates an Identity for the service identified by |resolved_url|.
+ // If |new_process_per_connection| is true for the URL's options, then the
+ // identity is unique. Otherwise, repeated invocations with the same
+ // |resolved_url| will result in an equivalent Identity.
+ Identity MakeApplicationIdentity(const GURL& resolved_url);
+
mojo::InterfaceRequest<mojo::Application> RegisterShell(
// The URL after resolution and redirects, including the querystring.
const GURL& resolved_url,
@@ -234,7 +240,7 @@
scoped_ptr<NativeRunnerFactory> native_runner_factory_;
IdentityToShellImplMap identity_to_shell_impl_;
- URLToContentHandlerMap url_to_content_handler_;
+ IdentityToContentHandlerMap identity_to_content_handler_;
URLToArgsMap url_to_args_;
// Note: The keys are URLs after mapping and resolving.
URLToNativeOptionsMap url_to_native_options_;