Index: content/child/child_thread_impl.cc |
diff --git a/content/child/child_thread_impl.cc b/content/child/child_thread_impl.cc |
index b7aa75e4f8fb60c830c520f87e932987936424c7..b5637ea05b724ab3c8cee177851bfd267ea2cf2c 100644 |
--- a/content/child/child_thread_impl.cc |
+++ b/content/child/child_thread_impl.cc |
@@ -67,6 +67,7 @@ |
#include "ipc/mojo/ipc_channel_mojo.h" |
#include "ipc/mojo/scoped_ipc_support.h" |
#include "mojo/edk/embedder/embedder.h" |
+#include "mojo/edk/embedder/named_platform_channel_pair.h" |
#include "mojo/edk/embedder/platform_channel_pair.h" |
#if defined(OS_POSIX) |
@@ -229,9 +230,18 @@ base::LazyInstance<QuitClosure> g_quit_closure = LAZY_INSTANCE_INITIALIZER; |
void InitializeMojoIPCChannel() { |
mojo::edk::ScopedPlatformHandle platform_channel; |
#if defined(OS_WIN) |
- platform_channel = |
- mojo::edk::PlatformChannelPair::PassClientHandleFromParentProcess( |
- *base::CommandLine::ForCurrentProcess()); |
+ if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
+ mojo::edk::PlatformChannelPair::kMojoPlatformChannelHandleSwitch)) { |
ncarter (slow)
2016/05/11 00:14:23
The layering here feels little awkward -- content
Anand Mistry (off Chromium)
2016/05/11 04:15:20
Hm. I agree that the switch should be moved to con
ncarter (slow)
2016/05/11 16:06:07
Follow-on CL is totally fine.
|
+ platform_channel = |
+ mojo::edk::PlatformChannelPair::PassClientHandleFromParentProcess( |
+ *base::CommandLine::ForCurrentProcess()); |
+ } else { |
+ // If this process is elevated, it will have a pipe path passed on the |
+ // command line. |
+ platform_channel = |
+ mojo::edk::NamedPlatformChannelPair::PassClientHandleFromParentProcess( |
+ *base::CommandLine::ForCurrentProcess()); |
+ } |
#elif defined(OS_POSIX) |
platform_channel.reset(mojo::edk::PlatformHandle( |
base::GlobalDescriptors::GetInstance()->Get(kMojoIPCChannel))); |