| Index: content/child/child_thread_impl.cc
|
| diff --git a/content/child/child_thread_impl.cc b/content/child/child_thread_impl.cc
|
| index dbf6c3be0c2d5c13d2029ae0554bf191ce8b443f..06d4afca69368a80c092b03babe9617fb7cfd50a 100644
|
| --- a/content/child/child_thread_impl.cc
|
| +++ b/content/child/child_thread_impl.cc
|
| @@ -367,14 +367,7 @@ void ChildThreadImpl::Init(const Options& options) {
|
| IPC::Logging::GetInstance();
|
| #endif
|
|
|
| -#if USE_ATTACHMENT_BROKER
|
| - // The only reason a global would already exist is if the thread is being run
|
| - // in the browser process because of a command line switch.
|
| - if (!IPC::AttachmentBroker::GetGlobal()) {
|
| - attachment_broker_.reset(
|
| - IPC::AttachmentBrokerUnprivileged::CreateBroker().release());
|
| - }
|
| -#endif
|
| + IPC::AttachmentBrokerUnprivileged::CreateBrokerIfNeeded();
|
|
|
| channel_ =
|
| IPC::SyncChannel::Create(this, ChildProcess::current()->io_task_runner(),
|
| @@ -460,8 +453,9 @@ void ChildThreadImpl::Init(const Options& options) {
|
| }
|
|
|
| ConnectChannel(options.use_mojo_channel);
|
| - if (attachment_broker_)
|
| - attachment_broker_->DesignateBrokerCommunicationChannel(channel_.get());
|
| + IPC::AttachmentBroker* broker = IPC::AttachmentBroker::GetGlobal();
|
| + if (broker && !broker->IsPrivilegedBroker())
|
| + broker->RegisterBrokerCommunicationChannel(channel_.get());
|
|
|
| int connection_timeout = kConnectionTimeoutS;
|
| std::string connection_override =
|
| @@ -497,6 +491,10 @@ ChildThreadImpl::~ChildThreadImpl() {
|
| IPC::Logging::GetInstance()->SetIPCSender(NULL);
|
| #endif
|
|
|
| + IPC::AttachmentBroker* broker = IPC::AttachmentBroker::GetGlobal();
|
| + if (broker && !broker->IsPrivilegedBroker())
|
| + broker->DeregisterBrokerCommunicationChannel(channel_.get());
|
| +
|
| channel_->RemoveFilter(histogram_message_filter_.get());
|
| channel_->RemoveFilter(sync_message_filter_.get());
|
|
|
|
|