| Index: content/common/child_process_host_impl.cc
|
| diff --git a/content/common/child_process_host_impl.cc b/content/common/child_process_host_impl.cc
|
| index 3fa4dc89cf090a7724956b500b49ac2a2a802bab..45ede038c7fcb78675d971d27e87735d1292c7e2 100644
|
| --- a/content/common/child_process_host_impl.cc
|
| +++ b/content/common/child_process_host_impl.cc
|
| @@ -9,6 +9,7 @@
|
| #include "base/atomic_sequence_num.h"
|
| #include "base/command_line.h"
|
| #include "base/files/file_path.h"
|
| +#include "base/lazy_instance.h"
|
| #include "base/logging.h"
|
| #include "base/metrics/histogram.h"
|
| #include "base/numerics/safe_math.h"
|
| @@ -30,8 +31,14 @@
|
| #include "base/linux_util.h"
|
| #elif defined(OS_WIN)
|
| #include "content/common/font_cache_dispatcher_win.h"
|
| +#include "ipc/attachment_broker_win.h"
|
| #endif // OS_LINUX
|
|
|
| +#if defined(OS_WIN)
|
| +base::LazyInstance<IPC::AttachmentBrokerWin>::Leaky g_attachment_broker =
|
| + LAZY_INSTANCE_INITIALIZER;
|
| +#endif // defined(OS_WIN)
|
| +
|
| namespace {
|
|
|
| #if defined(OS_MACOSX)
|
| @@ -137,6 +144,15 @@ base::FilePath ChildProcessHost::GetChildPath(int flags) {
|
| return child_path;
|
| }
|
|
|
| +// static
|
| +IPC::AttachmentBroker* ChildProcessHost::GetAttachmentBroker() {
|
| +#if defined(OS_WIN)
|
| + return &g_attachment_broker.Get();
|
| +#else
|
| + return nullptr;
|
| +#endif // defined(OS_WIN)
|
| +}
|
| +
|
| ChildProcessHostImpl::ChildProcessHostImpl(ChildProcessHostDelegate* delegate)
|
| : delegate_(delegate),
|
| opening_channel_(false) {
|
| @@ -165,7 +181,8 @@ void ChildProcessHostImpl::ForceShutdown() {
|
|
|
| std::string ChildProcessHostImpl::CreateChannel() {
|
| channel_id_ = IPC::Channel::GenerateVerifiedChannelID(std::string());
|
| - channel_ = IPC::Channel::CreateServer(channel_id_, this);
|
| + channel_ =
|
| + IPC::Channel::CreateServer(channel_id_, this, GetAttachmentBroker());
|
| if (!channel_->Connect())
|
| return std::string();
|
|
|
|
|