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

Unified Diff: content/browser/child_process_launcher.cc

Issue 2009033002: Revert of [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: 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/child_process_launcher.h ('k') | content/browser/utility_process_host_impl_browsertest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/child_process_launcher.cc
diff --git a/content/browser/child_process_launcher.cc b/content/browser/child_process_launcher.cc
index 36f0c5098c7207548f6ebf73ae41f2bf63daad27..6b88b049946b6e3165a108430f2bb2949814d283 100644
--- a/content/browser/child_process_launcher.cc
+++ b/content/browser/child_process_launcher.cc
@@ -25,8 +25,6 @@
#include "content/public/common/result_codes.h"
#include "content/public/common/sandboxed_process_launcher_delegate.h"
#include "mojo/edk/embedder/embedder.h"
-#include "mojo/edk/embedder/named_platform_channel_pair.h"
-#include "mojo/edk/embedder/platform_channel_pair.h"
#include "mojo/edk/embedder/scoped_platform_handle.h"
#if defined(OS_WIN)
@@ -144,8 +142,9 @@
base::Process process;
#if defined(OS_WIN)
if (launch_elevated) {
- // When establishing a Mojo connection, the pipe path has already been added
- // to the command line.
+ // TODO(rockot): We may want to support Mojo IPC to elevated processes as
+ // well, but this isn't currently feasible without sharing a pipe path on
+ // the command line as elevated process launch goes through ShellExecuteEx.
base::LaunchOptions options;
options.start_hidden = true;
process = base::LaunchElevatedProcess(*cmd_line, options);
@@ -455,19 +454,8 @@
NotifyCallback reply_callback(base::Bind(&ChildProcessLauncher::DidLaunch,
weak_factory_.GetWeakPtr(),
terminate_child_on_shutdown_));
- mojo::edk::ScopedPlatformHandle client_handle;
-#if defined(OS_WIN)
- if (delegate->ShouldLaunchElevated()) {
- mojo::edk::NamedPlatformChannelPair named_pair;
- mojo_host_platform_handle_ = named_pair.PassServerHandle();
- named_pair.PrepareToPassClientHandleToChildProcess(cmd_line);
- } else
-#endif
- {
- mojo::edk::PlatformChannelPair channel_pair;
- mojo_host_platform_handle_ = channel_pair.PassServerHandle();
- client_handle = channel_pair.PassClientHandle();
- }
+ mojo::edk::ScopedPlatformHandle client_handle =
+ mojo_platform_channel_.PassClientHandle();
BrowserThread::PostTask(
BrowserThread::PROCESS_LAUNCHER, FROM_HERE,
base::Bind(&LaunchOnLauncherThread, reply_callback, client_thread_id_,
@@ -557,7 +545,7 @@
if (process_.IsValid()) {
// Set up Mojo IPC to the new process.
mojo::edk::ChildProcessLaunched(process_.Handle(),
- std::move(mojo_host_platform_handle_));
+ mojo_platform_channel_.PassServerHandle());
}
#if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_ANDROID)
« no previous file with comments | « content/browser/child_process_launcher.h ('k') | content/browser/utility_process_host_impl_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698