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

Unified Diff: components/nacl/broker/nacl_broker_listener.cc

Issue 1704743002: Revert of Clean up public interface of AttachmentBrokerUnprivileged. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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/broker/nacl_broker_listener.h ('k') | components/nacl/loader/nacl_listener.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/nacl/broker/nacl_broker_listener.cc
diff --git a/components/nacl/broker/nacl_broker_listener.cc b/components/nacl/broker/nacl_broker_listener.cc
index aedf5149d6f63471237b52c727f1b5bf1bced111..cb104058082acf4b120eae0c92599ed514475122 100644
--- a/components/nacl/broker/nacl_broker_listener.cc
+++ b/components/nacl/broker/nacl_broker_listener.cc
@@ -32,13 +32,11 @@
} // namespace
NaClBrokerListener::NaClBrokerListener() {
- IPC::AttachmentBrokerUnprivileged::CreateBrokerIfNeeded();
+ attachment_broker_.reset(
+ IPC::AttachmentBrokerUnprivileged::CreateBroker().release());
}
NaClBrokerListener::~NaClBrokerListener() {
- IPC::AttachmentBroker* broker = IPC::AttachmentBroker::GetGlobal();
- if (broker && !broker->IsPrivilegedBroker() && channel_)
- broker->DeregisterBrokerCommunicationChannel(channel_.get());
}
void NaClBrokerListener::Listen() {
@@ -46,9 +44,8 @@
base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
switches::kProcessChannelID);
channel_ = IPC::Channel::CreateClient(channel_name, this);
- IPC::AttachmentBroker* broker = IPC::AttachmentBroker::GetGlobal();
- if (broker && !broker->IsPrivilegedBroker())
- broker->RegisterBrokerCommunicationChannel(channel_.get());
+ if (attachment_broker_.get())
+ attachment_broker_->DesignateBrokerCommunicationChannel(channel_.get());
CHECK(channel_->Connect());
base::MessageLoop::current()->Run();
}
« no previous file with comments | « components/nacl/broker/nacl_broker_listener.h ('k') | components/nacl/loader/nacl_listener.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698