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

Unified Diff: content/child/child_thread_impl.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 | « content/child/child_thread_impl.h ('k') | ipc/attachment_broker.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/child/child_thread_impl.cc
diff --git a/content/child/child_thread_impl.cc b/content/child/child_thread_impl.cc
index 06d4afca69368a80c092b03babe9617fb7cfd50a..dbf6c3be0c2d5c13d2029ae0554bf191ce8b443f 100644
--- a/content/child/child_thread_impl.cc
+++ b/content/child/child_thread_impl.cc
@@ -367,7 +367,14 @@
IPC::Logging::GetInstance();
#endif
- IPC::AttachmentBrokerUnprivileged::CreateBrokerIfNeeded();
+#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
channel_ =
IPC::SyncChannel::Create(this, ChildProcess::current()->io_task_runner(),
@@ -453,9 +460,8 @@
}
ConnectChannel(options.use_mojo_channel);
- IPC::AttachmentBroker* broker = IPC::AttachmentBroker::GetGlobal();
- if (broker && !broker->IsPrivilegedBroker())
- broker->RegisterBrokerCommunicationChannel(channel_.get());
+ if (attachment_broker_)
+ attachment_broker_->DesignateBrokerCommunicationChannel(channel_.get());
int connection_timeout = kConnectionTimeoutS;
std::string connection_override =
@@ -490,10 +496,6 @@
#ifdef IPC_MESSAGE_LOG_ENABLED
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());
« no previous file with comments | « content/child/child_thread_impl.h ('k') | ipc/attachment_broker.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698