Index: content/browser/ppapi_plugin_process_host.cc |
diff --git a/content/browser/ppapi_plugin_process_host.cc b/content/browser/ppapi_plugin_process_host.cc |
index 478f476f36d1370785b56029fe2e4173c588db02..0d8d1708f9d67e61f29b968c241e018570ae4743 100644 |
--- a/content/browser/ppapi_plugin_process_host.cc |
+++ b/content/browser/ppapi_plugin_process_host.cc |
@@ -26,6 +26,7 @@ |
#include "content/public/browser/content_browser_client.h" |
#include "content/public/common/content_constants.h" |
#include "content/public/common/content_switches.h" |
+#include "content/public/common/mojo_channel_switches.h" |
#include "content/public/common/pepper_plugin_info.h" |
#include "content/public/common/process_type.h" |
#include "content/public/common/sandbox_type.h" |
@@ -317,7 +318,8 @@ PpapiPluginProcessHost::PpapiPluginProcessHost( |
const PepperPluginInfo& info, |
const base::FilePath& profile_data_directory) |
: profile_data_directory_(profile_data_directory), |
- is_broker_(false) { |
+ is_broker_(false), |
+ mojo_child_token_(mojo::edk::GenerateRandomToken()) { |
uint32_t base_permissions = info.permissions; |
// We don't have to do any whitelisting for APIs in this process host, so |
@@ -328,7 +330,7 @@ PpapiPluginProcessHost::PpapiPluginProcessHost( |
permissions_ = ppapi::PpapiPermissions::GetForCommandLine(base_permissions); |
process_.reset(new BrowserChildProcessHostImpl( |
- PROCESS_TYPE_PPAPI_PLUGIN, this, mojo::edk::GenerateRandomToken())); |
+ PROCESS_TYPE_PPAPI_PLUGIN, this, mojo_child_token_)); |
host_impl_.reset(new BrowserPpapiHostImpl(this, permissions_, info.name, |
info.path, profile_data_directory, |
@@ -350,9 +352,10 @@ PpapiPluginProcessHost::PpapiPluginProcessHost( |
} |
PpapiPluginProcessHost::PpapiPluginProcessHost() |
- : is_broker_(true) { |
+ : is_broker_(true), |
+ mojo_child_token_(mojo::edk::GenerateRandomToken()) { |
process_.reset(new BrowserChildProcessHostImpl( |
- PROCESS_TYPE_PPAPI_BROKER, this, mojo::edk::GenerateRandomToken())); |
+ PROCESS_TYPE_PPAPI_BROKER, this, mojo_child_token_)); |
ppapi::PpapiPermissions permissions; // No permissions. |
// The plugin name, path and profile data directory shouldn't be needed for |
@@ -372,8 +375,9 @@ bool PpapiPluginProcessHost::Init(const PepperPluginInfo& info) { |
process_->SetName(base::UTF8ToUTF16(info.name)); |
} |
- std::string channel_id = process_->GetHost()->CreateChannel(); |
- if (channel_id.empty()) { |
+ std::string mojo_channel_token = |
+ process_->GetHost()->CreateChannelMojo(mojo_child_token_); |
+ if (mojo_channel_token.empty()) { |
VLOG(1) << "Could not create pepper host channel."; |
return false; |
} |
@@ -399,7 +403,7 @@ bool PpapiPluginProcessHost::Init(const PepperPluginInfo& info) { |
cmd_line->AppendSwitchASCII(switches::kProcessType, |
is_broker_ ? switches::kPpapiBrokerProcess |
: switches::kPpapiPluginProcess); |
- cmd_line->AppendSwitchASCII(switches::kProcessChannelID, channel_id); |
+ cmd_line->AppendSwitchASCII(switches::kMojoChannelToken, mojo_channel_token); |
#if defined(OS_WIN) |
if (GetContentClient()->browser()->ShouldUseWindowsPrefetchArgument()) { |