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

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: Always use token init. 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
« no previous file with comments | « content/child/child_thread_impl.h ('k') | content/child/mojo/mojo_application.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..173fb08441cf43f5c35897370cdbed344a2e8acd 100644
--- a/content/child/child_thread_impl.cc
+++ b/content/child/child_thread_impl.cc
@@ -266,6 +266,7 @@ 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_token = params.application_token();
return *this;
}
@@ -390,6 +391,16 @@ void ChildThreadImpl::Init(const Options& options) {
}
mojo_application_.reset(new MojoApplication(GetIOTaskRunner()));
+ std::string mojo_application_token;
+ if (!IsInBrowserProcess()) {
+ mojo_application_token =
+ base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
+ switches::kMojoApplicationChannelToken);
+ } else {
+ mojo_application_token = options.in_process_application_token;
+ }
+ if (!mojo_application_token.empty())
+ mojo_application_->InitWithToken(mojo_application_token);
sync_message_filter_ = channel_->CreateSyncMessageFilter();
thread_safe_sender_ = new ThreadSafeSender(
« no previous file with comments | « content/child/child_thread_impl.h ('k') | content/child/mojo/mojo_application.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698