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

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

Issue 1679763002: Clean up public interface of AttachmentBrokerUnprivileged. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Compile error. 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
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 cb104058082acf4b120eae0c92599ed514475122..78da409e0abe7e3fa0e3c0b3b40a1789e4e82731 100644
--- a/components/nacl/broker/nacl_broker_listener.cc
+++ b/components/nacl/broker/nacl_broker_listener.cc
@@ -32,8 +32,7 @@ void SendReply(IPC::Channel* channel, int32_t pid, bool result) {
} // namespace
NaClBrokerListener::NaClBrokerListener() {
- attachment_broker_.reset(
- IPC::AttachmentBrokerUnprivileged::CreateBroker().release());
+ IPC::AttachmentBrokerUnprivileged::CreateBrokerIfNeeded();
}
NaClBrokerListener::~NaClBrokerListener() {
@@ -44,8 +43,9 @@ void NaClBrokerListener::Listen() {
base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
switches::kProcessChannelID);
channel_ = IPC::Channel::CreateClient(channel_name, this);
- if (attachment_broker_.get())
- attachment_broker_->DesignateBrokerCommunicationChannel(channel_.get());
+ IPC::AttachmentBroker* global = IPC::AttachmentBroker::GetGlobal();
+ if (global && !global->IsPrivilegedBroker())
+ global->DesignateBrokerCommunicationChannel(channel_.get());
CHECK(channel_->Connect());
base::MessageLoop::current()->Run();
}

Powered by Google App Engine
This is Rietveld 408576698