Index: components/nacl/loader/nacl_listener.cc |
diff --git a/components/nacl/loader/nacl_listener.cc b/components/nacl/loader/nacl_listener.cc |
index fae25366e0d89450600f9cefa15b2f917783f709..377a1cb81b7c472d3f22b5a004723b8ac8e95ec4 100644 |
--- a/components/nacl/loader/nacl_listener.cc |
+++ b/components/nacl/loader/nacl_listener.cc |
@@ -196,8 +196,7 @@ NaClListener::NaClListener() |
#endif |
main_loop_(NULL), |
is_started_(false) { |
- attachment_broker_.reset( |
- IPC::AttachmentBrokerUnprivileged::CreateBroker().release()); |
+ IPC::AttachmentBrokerUnprivileged::CreateBrokerIfNeeded(); |
io_thread_.StartWithOptions( |
base::Thread::Options(base::MessageLoop::TYPE_IO, 0)); |
DCHECK(g_listener == NULL); |
@@ -258,8 +257,9 @@ void NaClListener::Listen() { |
filter_ = channel_->CreateSyncMessageFilter(); |
channel_->AddFilter(new FileTokenMessageFilter()); |
channel_->Init(channel_name, IPC::Channel::MODE_CLIENT, true); |
- if (attachment_broker_.get()) |
- attachment_broker_->DesignateBrokerCommunicationChannel(channel_.get()); |
+ IPC::AttachmentBroker* global = IPC::AttachmentBroker::GetGlobal(); |
+ if (global && !global->IsPrivilegedBroker()) |
+ global->DesignateBrokerCommunicationChannel(channel_.get()); |
main_loop_ = base::MessageLoop::current(); |
main_loop_->Run(); |
} |