Index: content/browser/child_process_launcher.cc |
diff --git a/content/browser/child_process_launcher.cc b/content/browser/child_process_launcher.cc |
index 5d7a304e67e0edc18048df5a252ce10f7e033481..0470e1a36b288a40b5e97f6157acf67b5b65692b 100644 |
--- a/content/browser/child_process_launcher.cc |
+++ b/content/browser/child_process_launcher.cc |
@@ -90,7 +90,6 @@ void RecordHistogramsOnLauncherThread(base::TimeDelta launch_time) { |
void OnChildProcessStartedAndroid(const NotifyCallback& callback, |
BrowserThread::ID client_thread_id, |
const base::TimeTicks begin_launch_time, |
- base::ScopedFD ipcfd, |
base::ScopedFD mojo_fd, |
base::ProcessHandle handle) { |
int launch_result = (handle == base::kNullProcessHandle) |
@@ -103,7 +102,7 @@ void OnChildProcessStartedAndroid(const NotifyCallback& callback, |
base::Bind(&RecordHistogramsOnLauncherThread, launch_time)); |
base::Closure callback_on_client_thread(base::Bind( |
- callback, nullptr, base::Passed(&ipcfd), base::Passed(&mojo_fd), |
+ callback, nullptr, base::Passed(&mojo_fd), |
base::Passed(base::Process(handle)), launch_result)); |
if (BrowserThread::CurrentlyOn(client_thread_id)) { |
callback_on_client_thread.Run(); |
@@ -118,9 +117,6 @@ void LaunchOnLauncherThread(const NotifyCallback& callback, |
BrowserThread::ID client_thread_id, |
int child_process_id, |
SandboxedProcessLauncherDelegate* delegate, |
-#if defined(OS_ANDROID) |
- base::ScopedFD ipcfd, |
-#endif |
mojo::edk::ScopedPlatformHandle client_handle, |
base::CommandLine* cmd_line) { |
DCHECK_CURRENTLY_ON(BrowserThread::PROCESS_LAUNCHER); |
@@ -133,10 +129,8 @@ void LaunchOnLauncherThread(const NotifyCallback& callback, |
bool launch_elevated = delegate->ShouldLaunchElevated(); |
#elif defined(OS_MACOSX) |
base::EnvironmentMap env = delegate->GetEnvironment(); |
- base::ScopedFD ipcfd = delegate->TakeIpcFd(); |
#elif defined(OS_POSIX) && !defined(OS_ANDROID) |
base::EnvironmentMap env = delegate->GetEnvironment(); |
- base::ScopedFD ipcfd = delegate->TakeIpcFd(); |
#endif |
std::unique_ptr<base::CommandLine> cmd_line_deleter(cmd_line); |
base::TimeTicks begin_launch_time = base::TimeTicks::Now(); |
@@ -168,12 +162,8 @@ void LaunchOnLauncherThread(const NotifyCallback& callback, |
DCHECK(mojo_fd.is_valid()); |
#if defined(OS_ANDROID) |
- if (ipcfd.get() != -1) |
- files_to_register->Share(kPrimaryIPCChannel, ipcfd.get()); |
files_to_register->Share(kMojoIPCChannel, mojo_fd.get()); |
#else |
- if (ipcfd.get() != -1) |
- files_to_register->Transfer(kPrimaryIPCChannel, std::move(ipcfd)); |
files_to_register->Transfer(kMojoIPCChannel, std::move(mojo_fd)); |
#endif |
#endif |
@@ -249,8 +239,7 @@ void LaunchOnLauncherThread(const NotifyCallback& callback, |
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(&mojo_fd))); |
#elif defined(OS_POSIX) |
// We need to close the client end of the IPC channel to reliably detect |
@@ -448,10 +437,6 @@ void ChildProcessLauncher::Launch( |
DCHECK(process_type == switches::kGpuProcess || |
!cmd_line->HasSwitch(switches::kNoSandbox)); |
- // We need to close the client end of the IPC channel to reliably detect |
- // child termination. We will close this fd after we create the child |
- // process which is asynchronous on Android. |
- base::ScopedFD ipcfd(delegate->TakeIpcFd().release()); |
#endif |
NotifyCallback reply_callback(base::Bind(&ChildProcessLauncher::DidLaunch, |
weak_factory_.GetWeakPtr(), |
@@ -473,9 +458,6 @@ void ChildProcessLauncher::Launch( |
BrowserThread::PROCESS_LAUNCHER, FROM_HERE, |
base::Bind(&LaunchOnLauncherThread, reply_callback, client_thread_id_, |
child_process_id, delegate, |
-#if defined(OS_ANDROID) |
- base::Passed(&ipcfd), |
-#endif |
base::Passed(&client_handle), cmd_line)); |
} |
@@ -519,7 +501,6 @@ void ChildProcessLauncher::DidLaunch( |
bool terminate_on_shutdown, |
ZygoteHandle zygote, |
#if defined(OS_ANDROID) |
- base::ScopedFD ipcfd, |
base::ScopedFD mojo_fd, |
#endif |
base::Process process, |
@@ -528,12 +509,7 @@ void ChildProcessLauncher::DidLaunch( |
LOG(ERROR) << "Failed to launch child process"; |
if (instance.get()) { |
- instance->Notify(zygote, |
-#if defined(OS_ANDROID) |
- std::move(ipcfd), |
-#endif |
- std::move(process), |
- error_code); |
+ instance->Notify(zygote, std::move(process), error_code); |
} else { |
if (process.IsValid() && terminate_on_shutdown) { |
// On Posix, EnsureProcessTerminated can lead to 2 seconds of sleep! So |
@@ -546,9 +522,6 @@ void ChildProcessLauncher::DidLaunch( |
} |
void ChildProcessLauncher::Notify(ZygoteHandle zygote, |
-#if defined(OS_ANDROID) |
- base::ScopedFD ipcfd, |
-#endif |
base::Process process, |
int error_code) { |
DCHECK(CalledOnValidThread()); |