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

Unified Diff: content/browser/child_process_launcher.cc

Issue 2686983003: Avoid a thread hop when initializing IPC to new processes (Closed)
Patch Set: . Created 3 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/child_process_launcher_helper.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 3700f47e04cbb73127724b397919d1998f57aba2..686a7206b9928f4c506501136de6b1e42bb22ce4 100644
--- a/content/browser/child_process_launcher.cc
+++ b/content/browser/child_process_launcher.cc
@@ -30,7 +30,6 @@ ChildProcessLauncher::ChildProcessLauncher(
termination_status_(base::TERMINATION_STATUS_NORMAL_TERMINATION),
exit_code_(RESULT_CODE_NORMAL_EXIT),
starting_(true),
- pending_connection_(std::move(pending_connection)),
process_error_callback_(process_error_callback),
#if defined(ADDRESS_SANITIZER) || defined(LEAK_SANITIZER) || \
defined(MEMORY_SANITIZER) || defined(THREAD_SANITIZER) || \
@@ -44,9 +43,10 @@ ChildProcessLauncher::ChildProcessLauncher(
CHECK(BrowserThread::GetCurrentThreadIdentifier(&client_thread_id_));
helper_ = new ChildProcessLauncherHelper(
- child_process_id, client_thread_id_,
- std::move(command_line), std::move(delegate),
- weak_factory_.GetWeakPtr(), terminate_on_shutdown);
+ child_process_id, client_thread_id_, std::move(command_line),
+ std::move(delegate), std::move(pending_connection),
+ process_error_callback_, weak_factory_.GetWeakPtr(),
+ terminate_on_shutdown);
helper_->StartLaunchOnClientThread();
}
@@ -70,24 +70,15 @@ void ChildProcessLauncher::SetProcessBackgrounded(bool background) {
background));
}
-void ChildProcessLauncher::Notify(
- ChildProcessLauncherHelper::Process process,
- mojo::edk::ScopedPlatformHandle server_handle,
- int error_code) {
+void ChildProcessLauncher::Notify(ChildProcessLauncherHelper::Process process,
+ int error_code) {
DCHECK(CalledOnValidThread());
starting_ = false;
process_ = std::move(process);
// Take ownership of the pending connection here so it's destroyed when
// we go out of scope regardless of the outcome below.
- std::unique_ptr<mojo::edk::PendingProcessConnection> pending_connection =
- std::move(pending_connection_);
if (process_.process.IsValid()) {
- // Set up Mojo IPC to the new process.
- DCHECK(pending_connection);
- pending_connection->Connect(process_.process.Handle(),
- std::move(server_handle),
- process_error_callback_);
client_->OnProcessLaunched();
} else {
termination_status_ = base::TERMINATION_STATUS_LAUNCH_FAILED;
« no previous file with comments | « content/browser/child_process_launcher.h ('k') | content/browser/child_process_launcher_helper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698