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

Unified Diff: components/nacl/browser/nacl_process_host.cc

Issue 2501913002: Change the NaCl loader and broker processes to use the ServiceManager. (Closed)
Patch Set: Created 4 years 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: components/nacl/browser/nacl_process_host.cc
diff --git a/components/nacl/browser/nacl_process_host.cc b/components/nacl/browser/nacl_process_host.cc
index f788ae4ff879018f76f793dfff2684d2336995de..f8b471185caaffbc90ef8ba30cafe9f6ec4d0124 100644
--- a/components/nacl/browser/nacl_process_host.cc
+++ b/components/nacl/browser/nacl_process_host.cc
@@ -37,6 +37,7 @@
#include "components/nacl/browser/nacl_browser_delegate.h"
#include "components/nacl/browser/nacl_host_message_filter.h"
#include "components/nacl/common/nacl_cmd_line.h"
+#include "components/nacl/common/nacl_constants.h"
#include "components/nacl/common/nacl_host_messages.h"
#include "components/nacl/common/nacl_messages.h"
#include "components/nacl/common/nacl_process_type.h"
@@ -228,11 +229,10 @@ NaClProcessHost::NaClProcessHost(
process_type_(process_type),
profile_directory_(profile_directory),
render_view_id_(render_view_id),
- mojo_child_token_(mojo::edk::GenerateRandomToken()),
weak_factory_(this) {
process_.reset(content::BrowserChildProcessHost::Create(
static_cast<content::ProcessType>(PROCESS_TYPE_NACL_LOADER), this,
- mojo_child_token_));
+ kNaClLoaderServiceName));
// Set the display name so the user knows what plugin the process is running.
// We aren't on the UI thread so getting the pref locale for language
@@ -500,15 +500,7 @@ void NaClProcessHost::LaunchNaClGdb() {
}
bool NaClProcessHost::LaunchSelLdr() {
- DCHECK(!mojo_child_token_.empty());
- std::string mojo_channel_token =
- process_->GetHost()->CreateChannelMojo(mojo_child_token_);
- // |mojo_child_token_| is no longer used.
- base::STLClearObject(&mojo_child_token_);
- if (mojo_channel_token.empty()) {
- SendErrorToRenderer("CreateChannelMojo() failed");
- return false;
- }
+ process_->GetHost()->CreateChannelMojo();
// Build command line for nacl.
@@ -566,7 +558,6 @@ bool NaClProcessHost::LaunchSelLdr() {
(uses_nonsfi_mode_ ?
switches::kNaClLoaderNonSfiProcess :
switches::kNaClLoaderProcess));
- cmd_line->AppendSwitchASCII(switches::kMojoChannelToken, mojo_channel_token);
if (NaClBrowser::GetDelegate()->DialogsAreSuppressed())
cmd_line->AppendSwitch(switches::kNoErrorDialogs);
@@ -578,7 +569,8 @@ bool NaClProcessHost::LaunchSelLdr() {
#if defined(OS_WIN)
if (RunningOnWOW64()) {
if (!NaClBrokerService::GetInstance()->LaunchLoader(
- weak_factory_.GetWeakPtr(), mojo_channel_token)) {
+ weak_factory_.GetWeakPtr(),
+ process_->GetServiceRequestChannelToken())) {
SendErrorToRenderer("broker service did not launch process");
return false;
}

Powered by Google App Engine
This is Rietveld 408576698