| 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 6515b8ed8edf755ab2b329592632ca4f98e01191..19d434485e9ccef46093d1e6ac4db6f951192dc6 100644
|
| --- a/content/browser/ppapi_plugin_process_host.cc
|
| +++ b/content/browser/ppapi_plugin_process_host.cc
|
| @@ -23,7 +23,6 @@
|
| #include "content/common/child_process_host_impl.h"
|
| #include "content/common/child_process_messages.h"
|
| #include "content/common/content_switches_internal.h"
|
| -#include "content/common/mojo/constants.h"
|
| #include "content/public/browser/content_browser_client.h"
|
| #include "content/public/common/content_constants.h"
|
| #include "content/public/common/content_switches.h"
|
| @@ -319,7 +318,8 @@
|
| 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
|
| @@ -330,7 +330,7 @@
|
| permissions_ = ppapi::PpapiPermissions::GetForCommandLine(base_permissions);
|
|
|
| process_.reset(new BrowserChildProcessHostImpl(
|
| - PROCESS_TYPE_PPAPI_PLUGIN, this, kPluginMojoApplicationName));
|
| + PROCESS_TYPE_PPAPI_PLUGIN, this, mojo_child_token_));
|
|
|
| host_impl_.reset(new BrowserPpapiHostImpl(this, permissions_, info.name,
|
| info.path, profile_data_directory,
|
| @@ -351,9 +351,11 @@
|
| network_observer_.reset(new PluginNetworkObserver(this));
|
| }
|
|
|
| -PpapiPluginProcessHost::PpapiPluginProcessHost() : is_broker_(true) {
|
| +PpapiPluginProcessHost::PpapiPluginProcessHost()
|
| + : is_broker_(true),
|
| + mojo_child_token_(mojo::edk::GenerateRandomToken()) {
|
| process_.reset(new BrowserChildProcessHostImpl(
|
| - PROCESS_TYPE_PPAPI_BROKER, this, kPluginMojoApplicationName));
|
| + 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
|
| @@ -373,7 +375,12 @@
|
| process_->SetName(base::UTF8ToUTF16(info.name));
|
| }
|
|
|
| - process_->GetHost()->CreateChannelMojo();
|
| + 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;
|
| + }
|
|
|
| const base::CommandLine& browser_command_line =
|
| *base::CommandLine::ForCurrentProcess();
|
| @@ -396,6 +403,7 @@
|
| cmd_line->AppendSwitchASCII(switches::kProcessType,
|
| is_broker_ ? switches::kPpapiBrokerProcess
|
| : switches::kPpapiPluginProcess);
|
| + cmd_line->AppendSwitchASCII(switches::kMojoChannelToken, mojo_channel_token);
|
|
|
| #if defined(OS_WIN)
|
| cmd_line->AppendArg(is_broker_ ? switches::kPrefetchArgumentPpapiBroker
|
|
|