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

Unified Diff: content/browser/child_process_launcher.cc

Issue 1748973003: Revert of Bootstrap Mojo IPC independent of Chrome IPC (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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/mojo/mojo_shell_client_host.h » ('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 257f71ac47a2acebc6abdeba2f7a2b7e14e07d33..cb2fa2d454dbc945f8789c5d1b6d8d8173dceb5b 100644
--- a/content/browser/child_process_launcher.cc
+++ b/content/browser/child_process_launcher.cc
@@ -24,13 +24,9 @@
#include "content/public/common/content_switches.h"
#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/scoped_platform_handle.h"
#if defined(OS_WIN)
#include "base/files/file_path.h"
-#include "base/win/scoped_handle.h"
-#include "base/win/win_util.h"
#include "content/common/sandbox_win.h"
#include "content/public/common/sandbox_init.h"
#elif defined(OS_MACOSX)
@@ -63,7 +59,6 @@
typedef base::Callback<void(ZygoteHandle,
#if defined(OS_ANDROID)
base::ScopedFD,
- base::ScopedFD,
#endif
base::Process)> NotifyCallback;
@@ -87,7 +82,6 @@
BrowserThread::ID client_thread_id,
const base::TimeTicks begin_launch_time,
base::ScopedFD ipcfd,
- base::ScopedFD mojo_fd,
base::ProcessHandle handle) {
// This can be called on the launcher thread or UI thread.
base::TimeDelta launch_time = base::TimeTicks::Now() - begin_launch_time;
@@ -97,7 +91,7 @@
base::Closure callback_on_client_thread(
base::Bind(callback, nullptr, base::Passed(&ipcfd),
- base::Passed(&mojo_fd), base::Passed(base::Process(handle))));
+ base::Passed(base::Process(handle))));
if (BrowserThread::CurrentlyOn(client_thread_id)) {
callback_on_client_thread.Run();
} else {
@@ -114,7 +108,6 @@
#if defined(OS_ANDROID)
base::ScopedFD ipcfd,
#endif
- mojo::edk::ScopedPlatformHandle client_handle,
base::CommandLine* cmd_line) {
DCHECK_CURRENTLY_ON(BrowserThread::PROCESS_LAUNCHER);
scoped_ptr<SandboxedProcessLauncherDelegate> delegate_deleter(delegate);
@@ -136,19 +129,12 @@
base::Process process;
#if defined(OS_WIN)
if (launch_elevated) {
- // 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);
} else {
- base::HandlesToInheritVector handles;
- handles.push_back(client_handle.get().handle);
- cmd_line->AppendSwitchASCII(
- mojo::edk::PlatformChannelPair::kMojoPlatformChannelHandleSwitch,
- base::UintToString(base::win::HandleToUint32(handles[0])));
- process = StartSandboxedProcess(delegate, cmd_line, handles);
+ process = StartSandboxedProcess(
+ delegate, cmd_line, base::HandlesToInheritVector());
}
#elif defined(OS_POSIX)
std::string process_type =
@@ -156,15 +142,10 @@
scoped_ptr<FileDescriptorInfo> files_to_register(
FileDescriptorInfoImpl::Create());
- base::ScopedFD mojo_fd(client_handle.release().handle);
- DCHECK(mojo_fd.is_valid());
-
#if defined(OS_ANDROID)
files_to_register->Share(kPrimaryIPCChannel, ipcfd.get());
- files_to_register->Share(kMojoIPCChannel, mojo_fd.get());
#else
files_to_register->Transfer(kPrimaryIPCChannel, std::move(ipcfd));
- files_to_register->Transfer(kMojoIPCChannel, std::move(mojo_fd));
#endif
#endif
@@ -242,8 +223,7 @@
StartChildProcess(
cmd_line->argv(), child_process_id, std::move(files_to_register), regions,
base::Bind(&OnChildProcessStartedAndroid, callback, client_thread_id,
- begin_launch_time, base::Passed(&ipcfd),
- base::Passed(&mojo_fd)));
+ begin_launch_time, base::Passed(&ipcfd)));
#elif defined(OS_POSIX)
// We need to close the client end of the IPC channel to reliably detect
@@ -443,8 +423,6 @@
NotifyCallback reply_callback(base::Bind(&ChildProcessLauncher::DidLaunch,
weak_factory_.GetWeakPtr(),
terminate_child_on_shutdown_));
- mojo::edk::ScopedPlatformHandle client_handle =
- mojo_platform_channel_.PassClientHandle();
BrowserThread::PostTask(
BrowserThread::PROCESS_LAUNCHER, FROM_HERE,
base::Bind(&LaunchOnLauncherThread, reply_callback, client_thread_id_,
@@ -452,7 +430,7 @@
#if defined(OS_ANDROID)
base::Passed(&ipcfd),
#endif
- base::Passed(&client_handle), cmd_line));
+ cmd_line));
}
void ChildProcessLauncher::UpdateTerminationStatus(bool known_dead) {
@@ -496,7 +474,6 @@
ZygoteHandle zygote,
#if defined(OS_ANDROID)
base::ScopedFD ipcfd,
- base::ScopedFD mojo_fd,
#endif
base::Process process) {
if (!process.IsValid())
@@ -527,12 +504,6 @@
DCHECK(CalledOnValidThread());
starting_ = false;
process_ = std::move(process);
-
- if (process_.IsValid()) {
- // Set up Mojo IPC to the new process.
- mojo::edk::ChildProcessLaunched(process_.Handle(),
- mojo_platform_channel_.PassServerHandle());
- }
#if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_ANDROID)
zygote_ = zygote;
« no previous file with comments | « content/browser/child_process_launcher.h ('k') | content/browser/mojo/mojo_shell_client_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698