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

Unified Diff: content/browser/ppapi_plugin_process_host.cc

Issue 8787004: Make ChildProcessHost be used through an interface in content/public, instead of by inheritence. (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
« no previous file with comments | « content/browser/plugin_process_host.cc ('k') | content/browser/renderer_host/mock_render_process_host.cc » ('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
===================================================================
--- content/browser/ppapi_plugin_process_host.cc (revision 112775)
+++ content/browser/ppapi_plugin_process_host.cc (working copy)
@@ -11,7 +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_host_impl.h"
#include "content/common/child_process_messages.h"
#include "content/public/common/content_switches.h"
#include "content/public/common/pepper_plugin_info.h"
@@ -20,6 +20,9 @@
#include "net/base/network_change_notifier.h"
#include "ppapi/proxy/ppapi_messages.h"
+using content::ChildProcessHost;
+using content::ChildProcessHostImpl;
+
class PpapiPluginProcessHost::PluginNetworkObserver
: public net::NetworkChangeNotifier::IPAddressObserver,
public net::NetworkChangeNotifier::OnlineStateObserver {
@@ -85,7 +88,7 @@
}
void PpapiPluginProcessHost::OpenChannelToPlugin(Client* client) {
- if (child_process_host()->opening_channel()) {
+ if (child_process_host()->IsChannelOpening()) {
// 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,14 +105,14 @@
filter_(new PepperMessageFilter(host_resolver)),
network_observer_(new PluginNetworkObserver(this)),
is_broker_(false),
- process_id_(ChildProcessHost::GenerateChildProcessUniqueId()) {
+ process_id_(ChildProcessHostImpl::GenerateChildProcessUniqueId()) {
child_process_host()->AddFilter(filter_.get());
}
PpapiPluginProcessHost::PpapiPluginProcessHost()
: BrowserChildProcessHost(content::PROCESS_TYPE_PPAPI_BROKER),
is_broker_(true),
- process_id_(ChildProcessHost::GenerateChildProcessUniqueId()) {
+ process_id_(ChildProcessHostImpl::GenerateChildProcessUniqueId()) {
}
bool PpapiPluginProcessHost::Init(const content::PepperPluginInfo& info) {
@@ -120,7 +123,8 @@
set_name(UTF8ToUTF16(info.name));
}
- if (!child_process_host()->CreateChannel())
+ std::string channel_id = child_process_host()->CreateChannel();
+ if (channel_id.empty())
return false;
const CommandLine& browser_command_line = *CommandLine::ForCurrentProcess();
@@ -141,8 +145,7 @@
cmd_line->AppendSwitchASCII(switches::kProcessType,
is_broker_ ? switches::kPpapiBrokerProcess
: switches::kPpapiPluginProcess);
- cmd_line->AppendSwitchASCII(switches::kProcessChannelID,
- child_process_host()->channel_id());
+ cmd_line->AppendSwitchASCII(switches::kProcessChannelID, channel_id);
// These switches are forwarded to both plugin and broker pocesses.
static const char* kCommonForwardSwitches[] = {
« no previous file with comments | « content/browser/plugin_process_host.cc ('k') | content/browser/renderer_host/mock_render_process_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698