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

Unified Diff: content/child/child_thread_impl.cc

Issue 1893313003: [mojo] Use a pipe path to initialise Mojo in elevated utility processes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 7 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 | « content/browser/utility_process_host_impl_browsertest.cc ('k') | mojo/edk/embedder/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/child/child_thread_impl.cc
diff --git a/content/child/child_thread_impl.cc b/content/child/child_thread_impl.cc
index d075663f99882d700079e604bf1ffe9cabda3180..b24a1450b0f14b564392342e2526042c5c731db6 100644
--- a/content/child/child_thread_impl.cc
+++ b/content/child/child_thread_impl.cc
@@ -66,6 +66,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)
@@ -228,9 +229,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)) {
+ 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)));
« no previous file with comments | « content/browser/utility_process_host_impl_browsertest.cc ('k') | mojo/edk/embedder/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698