Index: content/browser/mojo/mojo_child_connection.cc |
diff --git a/content/browser/mojo/mojo_child_connection.cc b/content/browser/mojo/mojo_child_connection.cc |
index b123240f55093c685b42686c841b436627af690b..6216909532b254ce6121fb0cc1e0311a95762e02 100644 |
--- a/content/browser/mojo/mojo_child_connection.cc |
+++ b/content/browser/mojo/mojo_child_connection.cc |
@@ -12,9 +12,12 @@ |
#include "base/thread_task_runner_handle.h" |
#include "build/build_config.h" |
#include "content/public/browser/browser_thread.h" |
+#include "content/public/browser/content_browser_client.h" |
#include "content/public/browser/render_process_host.h" |
#include "content/public/browser/render_process_host_observer.h" |
+#include "content/public/common/content_client.h" |
jam
2016/03/24 17:09:10
nit: by convention we don't include this when we i
Ken Rockot(use gerrit already)
2016/03/24 17:33:24
done
|
#include "content/public/common/mojo_shell_connection.h" |
+#include "content/public/common/process_type.h" |
jam
2016/03/24 17:09:10
nit: no point in including this, since by definiti
Ken Rockot(use gerrit already)
2016/03/24 17:33:24
done, though i'm not sure i agree with this policy
|
#include "ipc/ipc_sender.h" |
#include "mojo/converters/network/network_type_converters.h" |
#include "mojo/edk/embedder/embedder.h" |
@@ -101,6 +104,12 @@ std::string MojoConnectToChild(int child_process_id, |
if (!MojoShellConnection::Get()) |
return pipe_token; |
+ std::string child_name = |
+ GetContentClient()->browser()->GetMojoApplicationNameForProcess( |
+ PROCESS_TYPE_RENDERER); |
+ if (child_name.empty()) |
+ return pipe_token; |
+ |
mojo::shell::mojom::ShellClientPtr client; |
client.Bind(mojo::InterfacePtrInfo<mojo::shell::mojom::ShellClient>( |
std::move(shell_client_pipe), 0u)); |
@@ -110,9 +119,7 @@ std::string MojoConnectToChild(int child_process_id, |
// PIDSender manages its own lifetime. |
new PIDSender(render_process_host, std::move(pid_receiver)); |
- |
- mojo::Identity target("exe:chrome_renderer", |
- mojo::shell::mojom::kInheritUserID, |
+ mojo::Identity target(child_name, mojo::shell::mojom::kInheritUserID, |
base::StringPrintf("%d_%d", child_process_id, |
instance_id)); |
mojo::Connector::ConnectParams params(target); |