summaryrefslogtreecommitdiffstats
path: root/content/browser
diff options
context:
space:
mode:
authorjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-12-03 07:10:44 +0000
committerjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-12-03 07:10:44 +0000
commit4734d0becafa5b77d708020eed24d97148ea208d (patch)
treedb94ca97a1ac3f1831033ef07dbda98ccb53dfa6 /content/browser
parent463ea5fc399e6275a2351df6b398b7d91b8f5a61 (diff)
downloadchromium_src-4734d0becafa5b77d708020eed24d97148ea208d.zip
chromium_src-4734d0becafa5b77d708020eed24d97148ea208d.tar.gz
chromium_src-4734d0becafa5b77d708020eed24d97148ea208d.tar.bz2
Make ChildProcessHost be used through an interface in content/public, instead of by inheritence.
BUG=98716 Review URL: http://codereview.chromium.org/8787004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@112878 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser')
-rw-r--r--content/browser/browser_child_process_host.cc10
-rw-r--r--content/browser/browser_child_process_host.h10
-rw-r--r--content/browser/gpu/gpu_process_host.cc18
-rw-r--r--content/browser/gpu/gpu_process_host.h2
-rw-r--r--content/browser/plugin_data_remover_impl.cc5
-rw-r--r--content/browser/plugin_loader_posix.cc3
-rw-r--r--content/browser/plugin_process_host.cc11
-rw-r--r--content/browser/ppapi_plugin_process_host.cc17
-rw-r--r--content/browser/renderer_host/mock_render_process_host.cc6
-rw-r--r--content/browser/renderer_host/render_message_filter.cc6
-rw-r--r--content/browser/renderer_host/render_process_host_impl.cc8
-rw-r--r--content/browser/renderer_host/resource_dispatcher_host_unittest.cc5
-rw-r--r--content/browser/utility_process_host.cc9
-rw-r--r--content/browser/worker_host/worker_process_host.cc9
14 files changed, 69 insertions, 50 deletions
diff --git a/content/browser/browser_child_process_host.cc b/content/browser/browser_child_process_host.cc
index 7744153..93c997b 100644
--- a/content/browser/browser_child_process_host.cc
+++ b/content/browser/browser_child_process_host.cc
@@ -17,7 +17,7 @@
#include "content/browser/profiler_message_filter.h"
#include "content/browser/renderer_host/resource_message_filter.h"
#include "content/browser/trace_message_filter.h"
-#include "content/common/child_process_host.h"
+#include "content/common/child_process_host_impl.h"
#include "content/common/plugin_messages.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/child_process_data.h"
@@ -34,6 +34,8 @@
#endif
using content::BrowserThread;
+using content::ChildProcessHost;
+using content::ChildProcessHostImpl;
namespace {
@@ -60,9 +62,9 @@ BrowserChildProcessHost::BrowserChildProcessHost(
#endif
disconnect_was_alive_(false) {
data_.type = type;
- data_.id = ChildProcessHost::GenerateChildProcessUniqueId();
+ data_.id = ChildProcessHostImpl::GenerateChildProcessUniqueId();
- child_process_host_.reset(new ChildProcessHost(this));
+ child_process_host_.reset(ChildProcessHost::Create(this));
child_process_host_->AddFilter(new TraceMessageFilter);
child_process_host_->AddFilter(new ProfilerMessageFilter);
@@ -98,7 +100,7 @@ void BrowserChildProcessHost::Launch(
#elif defined(OS_POSIX)
use_zygote,
environ,
- child_process_host()->channel()->TakeClientFileDescriptor(),
+ child_process_host()->TakeClientFileDescriptor(),
#endif
cmd_line,
&client_));
diff --git a/content/browser/browser_child_process_host.h b/content/browser/browser_child_process_host.h
index 2abb0bf..a4eca07 100644
--- a/content/browser/browser_child_process_host.h
+++ b/content/browser/browser_child_process_host.h
@@ -19,12 +19,14 @@
#include "content/public/common/child_process_host_delegate.h"
#include "ipc/ipc_message.h"
-class ChildProcessHost;
-
namespace base {
class WaitableEvent;
}
+namespace content {
+class ChildProcessHost;
+}
+
// Plugins/workers and other child processes that live on the IO thread should
// derive from this class.
//
@@ -122,7 +124,7 @@ class CONTENT_EXPORT BrowserChildProcessHost :
// Sends the given notification on the UI thread.
void Notify(int type);
- ChildProcessHost* child_process_host() const {
+ content::ChildProcessHost* child_process_host() const {
return child_process_host_.get();
}
void set_name(const string16& name) { data_.name = name; }
@@ -141,7 +143,7 @@ class CONTENT_EXPORT BrowserChildProcessHost :
};
content::ChildProcessData data_;
- scoped_ptr<ChildProcessHost> child_process_host_;
+ scoped_ptr<content::ChildProcessHost> child_process_host_;
ClientHook client_;
scoped_ptr<ChildProcessLauncher> child_process_;
diff --git a/content/browser/gpu/gpu_process_host.cc b/content/browser/gpu/gpu_process_host.cc
index 3b18d38..9f0d735 100644
--- a/content/browser/gpu/gpu_process_host.cc
+++ b/content/browser/gpu/gpu_process_host.cc
@@ -17,7 +17,7 @@
#include "content/browser/gpu/gpu_process_host_ui_shim.h"
#include "content/browser/renderer_host/render_widget_host.h"
#include "content/browser/renderer_host/render_widget_host_view.h"
-#include "content/common/child_process_host.h"
+#include "content/common/child_process_host_impl.h"
#include "content/common/gpu/gpu_messages.h"
#include "content/gpu/gpu_child_thread.h"
#include "content/gpu/gpu_process.h"
@@ -35,6 +35,7 @@
#endif
using content::BrowserThread;
+using content::ChildProcessHost;
bool GpuProcessHost::gpu_enabled_ = true;
@@ -319,15 +320,15 @@ GpuProcessHost::~GpuProcessHost() {
}
bool GpuProcessHost::Init() {
- if (!child_process_host()->CreateChannel())
+ std::string channel_id = child_process_host()->CreateChannel();
+ if (channel_id.empty())
return false;
if (in_process_) {
CommandLine::ForCurrentProcess()->AppendSwitch(
switches::kDisableGpuWatchdog);
- in_process_gpu_thread_.reset(new GpuMainThread(
- child_process_host()->channel_id()));
+ in_process_gpu_thread_.reset(new GpuMainThread(channel_id));
base::Thread::Options options;
#if defined(OS_WIN)
@@ -343,7 +344,7 @@ bool GpuProcessHost::Init() {
in_process_gpu_thread_->StartWithOptions(options);
OnProcessLaunched(); // Fake a callback that the process is ready.
- } else if (!LaunchGpuProcess())
+ } else if (!LaunchGpuProcess(channel_id))
return false;
return Send(new GpuMsg_Initialize());
@@ -358,7 +359,7 @@ void GpuProcessHost::RouteOnUIThread(const IPC::Message& message) {
bool GpuProcessHost::Send(IPC::Message* msg) {
DCHECK(CalledOnValidThread());
- if (child_process_host()->opening_channel()) {
+ if (child_process_host()->IsChannelOpening()) {
queued_messages_.push(msg);
return true;
}
@@ -543,7 +544,7 @@ bool GpuProcessHost::software_rendering() {
return software_rendering_;
}
-bool GpuProcessHost::LaunchGpuProcess() {
+bool GpuProcessHost::LaunchGpuProcess(const std::string& channel_id) {
if (!gpu_enabled_ || g_gpu_crash_count >= kGpuMaxCrashCount) {
SendOutstandingReplies();
gpu_enabled_ = false;
@@ -568,8 +569,7 @@ bool GpuProcessHost::LaunchGpuProcess() {
CommandLine* cmd_line = new CommandLine(exe_path);
cmd_line->AppendSwitchASCII(switches::kProcessType, switches::kGpuProcess);
- cmd_line->AppendSwitchASCII(switches::kProcessChannelID,
- child_process_host()->channel_id());
+ cmd_line->AppendSwitchASCII(switches::kProcessChannelID, channel_id);
// Propagate relevant command line switches.
static const char* const kSwitchNames[] = {
diff --git a/content/browser/gpu/gpu_process_host.h b/content/browser/gpu/gpu_process_host.h
index 073e8fd..479ebae 100644
--- a/content/browser/gpu/gpu_process_host.h
+++ b/content/browser/gpu/gpu_process_host.h
@@ -102,7 +102,7 @@ class GpuProcessHost : public BrowserChildProcessHost,
gfx::PluginWindowHandle window, int32 renderer_id, int32 render_view_id);
void OnGraphicsInfoCollected(const content::GPUInfo& gpu_info);
- bool LaunchGpuProcess();
+ bool LaunchGpuProcess(const std::string& channel_id);
void SendOutstandingReplies();
void EstablishChannelError(
diff --git a/content/browser/plugin_data_remover_impl.cc b/content/browser/plugin_data_remover_impl.cc
index 38489d5..c41e913 100644
--- a/content/browser/plugin_data_remover_impl.cc
+++ b/content/browser/plugin_data_remover_impl.cc
@@ -10,12 +10,13 @@
#include "base/version.h"
#include "content/browser/plugin_process_host.h"
#include "content/browser/plugin_service.h"
-#include "content/common/child_process_host.h"
+#include "content/common/child_process_host_impl.h"
#include "content/common/plugin_messages.h"
#include "content/public/browser/browser_thread.h"
#include "webkit/plugins/npapi/plugin_group.h"
using content::BrowserThread;
+using content::ChildProcessHostImpl;
namespace {
@@ -93,7 +94,7 @@ class PluginDataRemoverImpl::Context
// PluginProcessHost::Client methods.
virtual int ID() OVERRIDE {
// Generate a unique identifier for this PluginProcessHostClient.
- return ChildProcessHost::GenerateChildProcessUniqueId();
+ return ChildProcessHostImpl::GenerateChildProcessUniqueId();
}
virtual bool OffTheRecord() OVERRIDE {
diff --git a/content/browser/plugin_loader_posix.cc b/content/browser/plugin_loader_posix.cc
index bc96427..26fe95e 100644
--- a/content/browser/plugin_loader_posix.cc
+++ b/content/browser/plugin_loader_posix.cc
@@ -8,12 +8,13 @@
#include "base/message_loop.h"
#include "base/message_loop_proxy.h"
#include "base/metrics/histogram.h"
-#include "content/common/child_process_host.h"
+#include "content/common/child_process_host_impl.h"
#include "content/common/utility_messages.h"
#include "content/public/browser/browser_thread.h"
#include "webkit/plugins/npapi/plugin_list.h"
using content::BrowserThread;
+using content::ChildProcessHost;
PluginLoaderPosix::PluginLoaderPosix()
: next_load_index_(0) {
diff --git a/content/browser/plugin_process_host.cc b/content/browser/plugin_process_host.cc
index 293072d..4989477 100644
--- a/content/browser/plugin_process_host.cc
+++ b/content/browser/plugin_process_host.cc
@@ -22,7 +22,7 @@
#include "base/string_util.h"
#include "base/utf_string_conversions.h"
#include "content/browser/plugin_service.h"
-#include "content/common/child_process_host.h"
+#include "content/common/child_process_host_impl.h"
#include "content/common/plugin_messages.h"
#include "content/common/resource_messages.h"
#include "content/public/browser/browser_thread.h"
@@ -36,6 +36,7 @@
#include "ui/gfx/native_widget_types.h"
using content::BrowserThread;
+using content::ChildProcessHost;
#if defined(USE_X11)
#include "ui/gfx/gtk_native_view_id_manager.h"
@@ -168,7 +169,8 @@ bool PluginProcessHost::Init(const webkit::WebPluginInfo& info,
info_ = info;
set_name(info_.name);
- if (!child_process_host()->CreateChannel())
+ std::string channel_id = child_process_host()->CreateChannel();
+ if (channel_id.empty())
return false;
// Build command line for plugin. When we have a plugin launcher, we can't
@@ -235,8 +237,7 @@ bool PluginProcessHost::Init(const webkit::WebPluginInfo& info,
cmd_line->AppendSwitchASCII(switches::kLang, locale);
}
- cmd_line->AppendSwitchASCII(switches::kProcessChannelID,
- child_process_host()->channel_id());
+ cmd_line->AppendSwitchASCII(switches::kProcessChannelID, channel_id);
#if defined(OS_POSIX)
base::environment_vector env;
@@ -366,7 +367,7 @@ void PluginProcessHost::CancelPendingRequestsForResourceContext(
void PluginProcessHost::OpenChannelToPlugin(Client* client) {
Notify(content::NOTIFICATION_CHILD_INSTANCE_CREATED);
client->SetPluginInfo(info_);
- 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.
diff --git a/content/browser/ppapi_plugin_process_host.cc b/content/browser/ppapi_plugin_process_host.cc
index f4ccd33..f633842 100644
--- a/content/browser/ppapi_plugin_process_host.cc
+++ b/content/browser/ppapi_plugin_process_host.cc
@@ -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 @@ PpapiPluginProcessHost* PpapiPluginProcessHost::CreateBrokerHost(
}
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 @@ PpapiPluginProcessHost::PpapiPluginProcessHost(net::HostResolver* host_resolver)
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 @@ bool PpapiPluginProcessHost::Init(const content::PepperPluginInfo& info) {
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 @@ bool PpapiPluginProcessHost::Init(const content::PepperPluginInfo& info) {
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[] = {
diff --git a/content/browser/renderer_host/mock_render_process_host.cc b/content/browser/renderer_host/mock_render_process_host.cc
index bc0d9d8..9f3bca7 100644
--- a/content/browser/renderer_host/mock_render_process_host.cc
+++ b/content/browser/renderer_host/mock_render_process_host.cc
@@ -9,16 +9,18 @@
#include "base/time.h"
#include "content/browser/child_process_security_policy.h"
#include "content/browser/renderer_host/render_process_host_impl.h"
-#include "content/common/child_process_host.h"
+#include "content/common/child_process_host_impl.h"
#include "content/public/browser/notification_service.h"
#include "content/public/browser/notification_types.h"
+using content::ChildProcessHostImpl;
+
MockRenderProcessHost::MockRenderProcessHost(
content::BrowserContext* browser_context)
: transport_dib_(NULL),
bad_msg_count_(0),
factory_(NULL),
- id_(ChildProcessHost::GenerateChildProcessUniqueId()),
+ id_(ChildProcessHostImpl::GenerateChildProcessUniqueId()),
browser_context_(browser_context),
max_page_id_(-1),
fast_shutdown_started_(false) {
diff --git a/content/browser/renderer_host/render_message_filter.cc b/content/browser/renderer_host/render_message_filter.cc
index f84b968..fe937b2 100644
--- a/content/browser/renderer_host/render_message_filter.cc
+++ b/content/browser/renderer_host/render_message_filter.cc
@@ -29,7 +29,7 @@
#include "content/browser/renderer_host/render_widget_helper.h"
#include "content/browser/resource_context.h"
#include "content/browser/user_metrics.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/common/desktop_notification_messages.h"
#include "content/common/view_messages.h"
@@ -67,6 +67,7 @@
#endif
using content::BrowserThread;
+using content::ChildProcessHostImpl;
using content::PluginServiceFilter;
using net::CookieStore;
@@ -686,7 +687,8 @@ void RenderMessageFilter::OnCheckNotificationPermission(
void RenderMessageFilter::OnAllocateSharedMemory(
uint32 buffer_size,
base::SharedMemoryHandle* handle) {
- ChildProcessHost::AllocateSharedMemory(buffer_size, peer_handle(), handle);
+ ChildProcessHostImpl::AllocateSharedMemory(
+ buffer_size, peer_handle(), handle);
}
net::URLRequestContext* RenderMessageFilter::GetRequestContextForURL(
diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc
index 4f05460..009b731 100644
--- a/content/browser/renderer_host/render_process_host_impl.cc
+++ b/content/browser/renderer_host/render_process_host_impl.cc
@@ -78,7 +78,7 @@
#include "content/browser/user_metrics.h"
#include "content/browser/webui/web_ui_factory.h"
#include "content/browser/worker_host/worker_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/common/gpu/gpu_messages.h"
#include "content/public/browser/notification_service.h"
@@ -112,6 +112,8 @@
#include "third_party/skia/include/core/SkBitmap.h"
using content::BrowserThread;
+using content::ChildProcessHost;
+using content::ChildProcessHostImpl;
// This class creates the IO thread for the renderer when running in
// single-process mode. It's not used in multi-process mode.
@@ -283,7 +285,7 @@ RenderProcessHostImpl::RenderProcessHostImpl(
this, &RenderProcessHostImpl::ClearTransportDIBCache)),
accessibility_enabled_(false),
is_initialized_(false),
- id_(ChildProcessHost::GenerateChildProcessUniqueId()),
+ id_(ChildProcessHostImpl::GenerateChildProcessUniqueId()),
browser_context_(browser_context),
sudden_termination_allowed_(true),
ignore_input_events_(false) {
@@ -387,7 +389,7 @@ bool RenderProcessHostImpl::Init(bool is_accessibility_enabled) {
// Setup the IPC channel.
const std::string channel_id =
- ChildProcessHost::GenerateRandomChannelID(this);
+ ChildProcessHostImpl::GenerateRandomChannelID(this);
channel_.reset(new IPC::ChannelProxy(
channel_id, IPC::Channel::MODE_SERVER, this,
BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO)));
diff --git a/content/browser/renderer_host/resource_dispatcher_host_unittest.cc b/content/browser/renderer_host/resource_dispatcher_host_unittest.cc
index ae610be..5c216fa 100644
--- a/content/browser/renderer_host/resource_dispatcher_host_unittest.cc
+++ b/content/browser/renderer_host/resource_dispatcher_host_unittest.cc
@@ -21,7 +21,7 @@
#include "content/browser/renderer_host/resource_dispatcher_host_request_info.h"
#include "content/browser/renderer_host/resource_handler.h"
#include "content/browser/renderer_host/resource_message_filter.h"
-#include "content/common/child_process_host.h"
+#include "content/common/child_process_host_impl.h"
#include "content/common/resource_messages.h"
#include "content/common/view_messages.h"
#include "content/public/common/resource_response.h"
@@ -36,6 +36,7 @@
using content::BrowserThread;
using content::BrowserThreadImpl;
+using content::ChildProcessHostImpl;
// TODO(eroman): Write unit tests for SafeBrowsing that exercise
// SafeBrowsingResourceHandler.
@@ -162,7 +163,7 @@ class ForwardingFilter : public ResourceMessageFilter {
public:
explicit ForwardingFilter(IPC::Message::Sender* dest)
: ResourceMessageFilter(
- ChildProcessHost::GenerateChildProcessUniqueId(),
+ ChildProcessHostImpl::GenerateChildProcessUniqueId(),
content::PROCESS_TYPE_RENDERER,
content::MockResourceContext::GetInstance(),
new MockURLRequestContextSelector(
diff --git a/content/browser/utility_process_host.cc b/content/browser/utility_process_host.cc
index 8bc2234..998f8a5 100644
--- a/content/browser/utility_process_host.cc
+++ b/content/browser/utility_process_host.cc
@@ -9,7 +9,7 @@
#include "base/command_line.h"
#include "base/message_loop.h"
#include "base/utf_string_conversions.h"
-#include "content/common/child_process_host.h"
+#include "content/common/child_process_host_impl.h"
#include "content/common/utility_messages.h"
#include "content/public/browser/content_browser_client.h"
#include "content/public/common/content_switches.h"
@@ -18,6 +18,7 @@
#include "webkit/plugins/plugin_switches.h"
using content::BrowserThread;
+using content::ChildProcessHost;
UtilityProcessHost::Client::Client() {
}
@@ -87,7 +88,8 @@ bool UtilityProcessHost::StartProcess() {
// launches a UtilityProcessHost.
set_name(ASCIIToUTF16("utility process"));
- if (!child_process_host()->CreateChannel())
+ std::string channel_id = child_process_host()->CreateChannel();
+ if (channel_id.empty())
return false;
FilePath exe_path = GetUtilityProcessCmd();
@@ -99,8 +101,7 @@ bool UtilityProcessHost::StartProcess() {
CommandLine* cmd_line = new CommandLine(exe_path);
cmd_line->AppendSwitchASCII(switches::kProcessType,
switches::kUtilityProcess);
- cmd_line->AppendSwitchASCII(switches::kProcessChannelID,
- child_process_host()->channel_id());
+ cmd_line->AppendSwitchASCII(switches::kProcessChannelID, channel_id);
std::string locale =
content::GetContentClient()->browser()->GetApplicationLocale();
cmd_line->AppendSwitchASCII(switches::kLang, locale);
diff --git a/content/browser/worker_host/worker_process_host.cc b/content/browser/worker_host/worker_process_host.cc
index 68d75c9..178de54 100644
--- a/content/browser/worker_host/worker_process_host.cc
+++ b/content/browser/worker_host/worker_process_host.cc
@@ -31,7 +31,7 @@
#include "content/browser/worker_host/message_port_service.h"
#include "content/browser/worker_host/worker_message_filter.h"
#include "content/browser/worker_host/worker_service.h"
-#include "content/common/child_process_host.h"
+#include "content/common/child_process_host_impl.h"
#include "content/common/debug_flags.h"
#include "content/common/view_messages.h"
#include "content/common/worker_messages.h"
@@ -49,6 +49,7 @@
#include "webkit/glue/resource_type.h"
using content::BrowserThread;
+using content::ChildProcessHost;
namespace {
@@ -112,7 +113,8 @@ WorkerProcessHost::~WorkerProcessHost() {
}
bool WorkerProcessHost::Init(int render_process_id) {
- if (!child_process_host()->CreateChannel())
+ std::string channel_id = child_process_host()->CreateChannel();
+ if (channel_id.empty())
return false;
#if defined(OS_LINUX)
@@ -127,8 +129,7 @@ bool WorkerProcessHost::Init(int render_process_id) {
CommandLine* cmd_line = new CommandLine(exe_path);
cmd_line->AppendSwitchASCII(switches::kProcessType, switches::kWorkerProcess);
- cmd_line->AppendSwitchASCII(switches::kProcessChannelID,
- child_process_host()->channel_id());
+ cmd_line->AppendSwitchASCII(switches::kProcessChannelID, channel_id);
std::string locale =
content::GetContentClient()->browser()->GetApplicationLocale();
cmd_line->AppendSwitchASCII(switches::kLang, locale);