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

Unified Diff: content/browser/child_process_launcher.cc

Issue 2476883002: Remove obsolete methods from IPC::Channel and related classes. (Closed)
Patch Set: Created 4 years, 1 month 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
Index: content/browser/child_process_launcher.cc
diff --git a/content/browser/child_process_launcher.cc b/content/browser/child_process_launcher.cc
index 92a3b0e78fe265556e83dffefe4b08d7d26d56ae..02387e09816cfd559f45903cbcef5edd0af3ab37 100644
--- a/content/browser/child_process_launcher.cc
+++ b/content/browser/child_process_launcher.cc
@@ -67,10 +67,10 @@ namespace {
typedef base::Callback<void(ZygoteHandle,
#if defined(OS_ANDROID)
base::ScopedFD,
- base::ScopedFD,
#endif
base::Process,
- int)> NotifyCallback;
+ int)>
+ NotifyCallback;
void RecordHistogramsOnLauncherThread(base::TimeDelta launch_time) {
DCHECK_CURRENTLY_ON(BrowserThread::PROCESS_LAUNCHER);
@@ -91,7 +91,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,9 +102,9 @@ void OnChildProcessStartedAndroid(const NotifyCallback& callback,
BrowserThread::PROCESS_LAUNCHER, FROM_HERE,
base::Bind(&RecordHistogramsOnLauncherThread, launch_time));
- base::Closure callback_on_client_thread(base::Bind(
- callback, nullptr, base::Passed(&ipcfd), base::Passed(&mojo_fd),
- base::Passed(base::Process(handle)), launch_result));
+ base::Closure callback_on_client_thread(
+ base::Bind(callback, nullptr, base::Passed(&mojo_fd),
+ base::Passed(base::Process(handle)), launch_result));
if (BrowserThread::CurrentlyOn(client_thread_id)) {
callback_on_client_thread.Run();
} else {
@@ -119,9 +118,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);
@@ -134,10 +130,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();
@@ -170,12 +164,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
@@ -253,8 +243,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
@@ -454,10 +443,6 @@ void ChildProcessLauncher::Launch(SandboxedProcessLauncherDelegate* delegate,
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
mojo::edk::ScopedPlatformHandle server_handle;
mojo::edk::ScopedPlatformHandle client_handle;
@@ -481,9 +466,6 @@ void ChildProcessLauncher::Launch(SandboxedProcessLauncherDelegate* delegate,
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));
}
@@ -528,7 +510,6 @@ void ChildProcessLauncher::DidLaunch(
mojo::edk::ScopedPlatformHandle server_handle,
ZygoteHandle zygote,
#if defined(OS_ANDROID)
- base::ScopedFD ipcfd,
base::ScopedFD mojo_fd,
#endif
base::Process process,
@@ -538,9 +519,6 @@ void ChildProcessLauncher::DidLaunch(
if (instance.get()) {
instance->Notify(zygote, std::move(server_handle),
-#if defined(OS_ANDROID)
- std::move(ipcfd),
-#endif
std::move(process), error_code);
} else {
if (process.IsValid() && terminate_on_shutdown) {
@@ -555,9 +533,6 @@ void ChildProcessLauncher::DidLaunch(
void ChildProcessLauncher::Notify(ZygoteHandle zygote,
mojo::edk::ScopedPlatformHandle server_handle,
-#if defined(OS_ANDROID)
- base::ScopedFD ipcfd,
-#endif
base::Process process,
int error_code) {
DCHECK(CalledOnValidThread());

Powered by Google App Engine
This is Rietveld 408576698