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

Unified Diff: content/child/child_thread_impl.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: content/child/child_thread_impl.cc
diff --git a/content/child/child_thread_impl.cc b/content/child/child_thread_impl.cc
index 5378463a0cdade74433293961bfc4ece5b7aea4b..eb8ee2546d642734838ba4e1c249e9eb6317416e 100644
--- a/content/child/child_thread_impl.cc
+++ b/content/child/child_thread_impl.cc
@@ -367,14 +367,7 @@ void ChildThreadImpl::Init(const Options& options) {
IPC::Logging::GetInstance();
#endif
-#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
+ IPC::AttachmentBrokerUnprivileged::CreateBrokerIfNeeded();
channel_ =
IPC::SyncChannel::Create(this, ChildProcess::current()->io_task_runner(),
@@ -460,8 +453,9 @@ void ChildThreadImpl::Init(const Options& options) {
}
ConnectChannel(options.use_mojo_channel);
- if (attachment_broker_)
- attachment_broker_->DesignateBrokerCommunicationChannel(channel_.get());
+ IPC::AttachmentBroker* global = IPC::AttachmentBroker::GetGlobal();
+ if (global && !global->IsPrivilegedBroker())
+ global->DesignateBrokerCommunicationChannel(channel_.get());
int connection_timeout = kConnectionTimeoutS;
std::string connection_override =

Powered by Google App Engine
This is Rietveld 408576698