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

Unified Diff: content/browser/ppapi_plugin_process_host.cc

Issue 8774040: Don't make classes derive from ChildProcessHost, and instead have them use it through composition... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 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: content/browser/ppapi_plugin_process_host.cc
===================================================================
--- content/browser/ppapi_plugin_process_host.cc (revision 112597)
+++ content/browser/ppapi_plugin_process_host.cc (working copy)
@@ -11,6 +11,7 @@
#include "base/utf_string_conversions.h"
#include "content/browser/plugin_service.h"
#include "content/browser/renderer_host/render_message_filter.h"
+#include "content/common/child_process_host.h"
#include "content/common/child_process_messages.h"
#include "content/public/common/content_switches.h"
#include "content/public/common/pepper_plugin_info.h"
@@ -84,7 +85,7 @@
}
void PpapiPluginProcessHost::OpenChannelToPlugin(Client* client) {
- if (opening_channel()) {
+ if (child_process_host()->opening_channel()) {
// The channel is already in the process of being opened. Put
// this "open channel" request into a queue of requests that will
// be run once the channel is open.
@@ -102,7 +103,7 @@
network_observer_(new PluginNetworkObserver(this)),
is_broker_(false),
process_id_(ChildProcessHost::GenerateChildProcessUniqueId()) {
- AddFilter(filter_.get());
+ child_process_host()->AddFilter(filter_.get());
}
PpapiPluginProcessHost::PpapiPluginProcessHost()
@@ -119,7 +120,7 @@
set_name(UTF8ToUTF16(info.name));
}
- if (!CreateChannel())
+ if (!child_process_host()->CreateChannel())
return false;
const CommandLine& browser_command_line = *CommandLine::ForCurrentProcess();
@@ -140,7 +141,8 @@
cmd_line->AppendSwitchASCII(switches::kProcessType,
is_broker_ ? switches::kPpapiBrokerProcess
: switches::kPpapiPluginProcess);
- cmd_line->AppendSwitchASCII(switches::kProcessChannelID, channel_id());
+ cmd_line->AppendSwitchASCII(switches::kProcessChannelID,
+ child_process_host()->channel_id());
// These switches are forwarded to both plugin and broker pocesses.
static const char* kCommonForwardSwitches[] = {
@@ -198,10 +200,6 @@
client->OnChannelOpened(base::kNullProcessHandle, IPC::ChannelHandle());
}
-bool PpapiPluginProcessHost::CanShutdown() {
- return true;
-}
-
void PpapiPluginProcessHost::OnProcessLaunched() {
}

Powered by Google App Engine
This is Rietveld 408576698