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

Unified Diff: content/browser/ppapi_plugin_process_host.cc

Issue 2221153003: Establish MojoChildConnection from BrowserChildProcessHostImpl (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@renderer-channel
Patch Set: rebase 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 19d434485e9ccef46093d1e6ac4db6f951192dc6..6515b8ed8edf755ab2b329592632ca4f98e01191 100644
--- a/content/browser/ppapi_plugin_process_host.cc
+++ b/content/browser/ppapi_plugin_process_host.cc
@@ -23,6 +23,7 @@
#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"
@@ -318,8 +319,7 @@ PpapiPluginProcessHost::PpapiPluginProcessHost(
const PepperPluginInfo& info,
const base::FilePath& profile_data_directory)
: profile_data_directory_(profile_data_directory),
- is_broker_(false),
- mojo_child_token_(mojo::edk::GenerateRandomToken()) {
+ is_broker_(false) {
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 @@ PpapiPluginProcessHost::PpapiPluginProcessHost(
permissions_ = ppapi::PpapiPermissions::GetForCommandLine(base_permissions);
process_.reset(new BrowserChildProcessHostImpl(
- PROCESS_TYPE_PPAPI_PLUGIN, this, mojo_child_token_));
+ PROCESS_TYPE_PPAPI_PLUGIN, this, kPluginMojoApplicationName));
host_impl_.reset(new BrowserPpapiHostImpl(this, permissions_, info.name,
info.path, profile_data_directory,
@@ -351,11 +351,9 @@ PpapiPluginProcessHost::PpapiPluginProcessHost(
network_observer_.reset(new PluginNetworkObserver(this));
}
-PpapiPluginProcessHost::PpapiPluginProcessHost()
- : is_broker_(true),
- mojo_child_token_(mojo::edk::GenerateRandomToken()) {
+PpapiPluginProcessHost::PpapiPluginProcessHost() : is_broker_(true) {
process_.reset(new BrowserChildProcessHostImpl(
- PROCESS_TYPE_PPAPI_BROKER, this, mojo_child_token_));
+ PROCESS_TYPE_PPAPI_BROKER, this, kPluginMojoApplicationName));
ppapi::PpapiPermissions permissions; // No permissions.
// The plugin name, path and profile data directory shouldn't be needed for
@@ -375,12 +373,7 @@ bool PpapiPluginProcessHost::Init(const PepperPluginInfo& info) {
process_->SetName(base::UTF8ToUTF16(info.name));
}
- 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;
- }
+ process_->GetHost()->CreateChannelMojo();
const base::CommandLine& browser_command_line =
*base::CommandLine::ForCurrentProcess();
@@ -403,7 +396,6 @@ bool PpapiPluginProcessHost::Init(const PepperPluginInfo& info) {
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