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

Unified Diff: content/browser/ppapi_plugin_process_host.cc

Issue 2230283003: Revert of Establish MojoChildConnection from BrowserChildProcessHostImpl (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@renderer-channel
Patch Set: Created 4 years, 4 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/ppapi_plugin_process_host.h ('k') | content/browser/utility_process_host_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « content/browser/ppapi_plugin_process_host.h ('k') | content/browser/utility_process_host_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698