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

Unified Diff: content/browser/child_process_launcher.cc

Issue 2019973002: [mojo-edk] Bind a child token to child launches and port reservations. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 6 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/gpu/gpu_process_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 36f0c5098c7207548f6ebf73ae41f2bf63daad27..ffd9c695ec677f782df3730b9873b1e55482624d 100644
--- a/content/browser/child_process_launcher.cc
+++ b/content/browser/child_process_launcher.cc
@@ -395,6 +395,7 @@ ChildProcessLauncher::ChildProcessLauncher(
base::CommandLine* cmd_line,
int child_process_id,
Client* client,
+ const std::string& mojo_child_token,
bool terminate_on_shutdown)
: client_(client),
termination_status_(base::TERMINATION_STATUS_NORMAL_TERMINATION),
@@ -408,6 +409,7 @@ ChildProcessLauncher::ChildProcessLauncher(
#else
terminate_child_on_shutdown_(terminate_on_shutdown),
#endif
+ mojo_child_token_(mojo_child_token),
weak_factory_(this) {
DCHECK(CalledOnValidThread());
CHECK(BrowserThread::GetCurrentThreadIdentifier(&client_thread_id_));
@@ -557,7 +559,8 @@ void ChildProcessLauncher::Notify(ZygoteHandle zygote,
if (process_.IsValid()) {
// Set up Mojo IPC to the new process.
mojo::edk::ChildProcessLaunched(process_.Handle(),
- std::move(mojo_host_platform_handle_));
+ std::move(mojo_host_platform_handle_),
+ mojo_child_token_);
}
#if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_ANDROID)
@@ -566,6 +569,7 @@ void ChildProcessLauncher::Notify(ZygoteHandle zygote,
if (process_.IsValid()) {
client_->OnProcessLaunched();
} else {
+ mojo::edk::ChildProcessLaunchFailed(mojo_child_token_);
termination_status_ = base::TERMINATION_STATUS_LAUNCH_FAILED;
client_->OnProcessLaunchFailed(error_code);
}
« no previous file with comments | « content/browser/child_process_launcher.h ('k') | content/browser/gpu/gpu_process_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698