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

Unified Diff: components/nacl/loader/nacl_listener.cc

Issue 1679763002: Clean up public interface of AttachmentBrokerUnprivileged. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove CHECK. Created 4 years, 10 months 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 | « components/nacl/loader/nacl_listener.h ('k') | content/child/child_thread_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..01c8c24d1f5984366ac44569a160b7238c89ea00 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->RegisterBrokerCommunicationChannel(channel_.get());
main_loop_ = base::MessageLoop::current();
main_loop_->Run();
}
« no previous file with comments | « components/nacl/loader/nacl_listener.h ('k') | content/child/child_thread_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698