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

Unified Diff: content/browser/utility_process_host_impl.cc

Issue 2163883005: WIP: Obtain Bootstrap from utility process Service (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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/mojo/service_manager_context_impl.cc ('k') | content/child/child_thread_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/utility_process_host_impl.cc
diff --git a/content/browser/utility_process_host_impl.cc b/content/browser/utility_process_host_impl.cc
index 64c7888620af616bf567dfb521d34b1bc6eda4e0..69849f8518a7ddd6dba0f80f23ce3e39691791c7 100644
--- a/content/browser/utility_process_host_impl.cc
+++ b/content/browser/utility_process_host_impl.cc
@@ -25,7 +25,7 @@
#include "content/browser/browser_child_process_host_impl.h"
#include "content/browser/mojo/constants.h"
#include "content/browser/mojo/mojo_child_connection.h"
-#include "content/browser/mojo/mojo_shell_context.h"
+#include "content/browser/mojo/service_manager_context_impl.h"
#include "content/browser/renderer_host/render_process_host_impl.h"
#include "content/common/child_process_host_impl.h"
#include "content/common/in_process_child_thread_params.h"
@@ -39,6 +39,7 @@
#include "content/public/common/process_type.h"
#include "content/public/common/sandbox_type.h"
#include "content/public/common/sandboxed_process_launcher_delegate.h"
+#include "ipc/ipc.mojom.h"
#include "ipc/ipc_switches.h"
#include "mojo/edk/embedder/embedder.h"
#include "services/shell/public/cpp/connection.h"
@@ -173,7 +174,7 @@ UtilityProcessHostImpl::UtilityProcessHostImpl(
mojo_child_connection_.reset(new MojoChildConnection(
kUtilityMojoApplicationName,
base::StringPrintf("%d_0", process_->GetData().id), child_token_,
- MojoShellContext::GetConnectorForIOThread(),
+ ServiceManagerContextImpl::GetConnectorForIOThread(),
BrowserThread::GetTaskRunnerForThread(BrowserThread::IO)));
}
@@ -268,9 +269,10 @@ bool UtilityProcessHostImpl::StartProcess() {
process_->SetName(name_);
- std::string mojo_channel_token =
- process_->GetHost()->CreateChannelMojo(child_token_);
- if (mojo_channel_token.empty()) {
+ IPC::mojom::BootstrapPtr bootstrap;
+ mojo_child_connection_->GetRemoteInterfaces()->GetInterface(&bootstrap);
+ if (!process_->GetHost()->CreateChannelMojoWithBootstrap(
+ bootstrap.PassInterface().PassHandle())) {
NotifyAndDelete(LAUNCH_RESULT_FAILURE);
return false;
}
@@ -283,7 +285,7 @@ bool UtilityProcessHostImpl::StartProcess() {
g_utility_main_thread_factory(InProcessChildThreadParams(
std::string(), BrowserThread::UnsafeGetMessageLoopForThread(
BrowserThread::IO)->task_runner(),
- mojo_channel_token, mojo_child_connection_->service_token())));
+ std::string(), mojo_child_connection_->service_token())));
in_process_thread_->Start();
} else {
const base::CommandLine& browser_command_line =
@@ -320,8 +322,6 @@ bool UtilityProcessHostImpl::StartProcess() {
cmd_line->AppendSwitchASCII(switches::kProcessType,
switches::kUtilityProcess);
- cmd_line->AppendSwitchASCII(switches::kMojoChannelToken,
- mojo_channel_token);
std::string locale = GetContentClient()->browser()->GetApplicationLocale();
cmd_line->AppendSwitchASCII(switches::kLang, locale);
« no previous file with comments | « content/browser/mojo/service_manager_context_impl.cc ('k') | content/child/child_thread_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698