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

Unified Diff: content/child/child_thread_impl.cc

Issue 1877743002: Use token-based initialisation for the utility process MojoApplication. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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
Index: content/child/child_thread_impl.cc
diff --git a/content/child/child_thread_impl.cc b/content/child/child_thread_impl.cc
index 9188e48e2bc86590831af1cd72602a194f119609..fda78fd1bf676ec8e63561d4c3d77374a1e242da 100644
--- a/content/child/child_thread_impl.cc
+++ b/content/child/child_thread_impl.cc
@@ -266,6 +266,8 @@ ChildThreadImpl::Options::Builder::InBrowserProcess(
options_.browser_process_io_runner = params.io_runner();
options_.channel_name = params.channel_name();
options_.in_process_message_pipe_handle = params.handle();
+ options_.in_process_application_message_pipe_handle =
+ params.application_handle();
return *this;
}
@@ -390,6 +392,18 @@ void ChildThreadImpl::Init(const Options& options) {
}
mojo_application_.reset(new MojoApplication(GetIOTaskRunner()));
+ if (!IsInBrowserProcess()) {
+ std::string mojo_application_token =
+ base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
+ switches::kMojoApplicationChannelToken);
+ if (!mojo_application_token.empty())
+ mojo_application_->InitWithToken(mojo_application_token);
+ } else {
+ mojo::ScopedMessagePipeHandle handle(
+ options.in_process_application_message_pipe_handle);
+ if (handle.is_valid())
+ mojo_application_->InitWithPipe(std::move(handle));
+ }
sync_message_filter_ = channel_->CreateSyncMessageFilter();
thread_safe_sender_ = new ThreadSafeSender(

Powered by Google App Engine
This is Rietveld 408576698