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

Unified Diff: content/browser/browser_main_loop.cc

Issue 1801123004: Move attachment broker setup to browser startup. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@mojo-mach-ports
Patch Set: Maybe fix tests. Created 4 years, 9 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/browser/browser_main_loop.cc
diff --git a/content/browser/browser_main_loop.cc b/content/browser/browser_main_loop.cc
index eab70cef7d941cdae667e16fdb9dbb2f9a6c59e9..3afbcccda2085a146fef76983b521f51677b02ec 100644
--- a/content/browser/browser_main_loop.cc
+++ b/content/browser/browser_main_loop.cc
@@ -98,6 +98,8 @@
#if !defined(OS_IOS)
#include "content/browser/renderer_host/render_process_host_impl.h"
+#include "ipc/attachment_broker.h"
+#include "ipc/attachment_broker_privileged.h"
#endif
#if defined(OS_ANDROID)
@@ -1206,6 +1208,19 @@ int BrowserMainLoop::BrowserThreadsStarted() {
#endif // defined(OS_MACOSX)
#endif // !defined(OS_IOS)
+#if USE_ATTACHMENT_BROKER
+ // Construct the privileged attachment broker early. This ensures that when a
+ // test is being run in one of the single process modes, the global attachment
+ // broker is the privileged attachment broker, rather than an unprivileged
+ // attachment broker.
+#if defined(OS_MACOSX) && !defined(OS_IOS)
+ IPC::AttachmentBrokerPrivileged::CreateBrokerIfNeeded(
+ MachBroker::GetInstance());
+#else
+ IPC::AttachmentBrokerPrivileged::CreateBrokerIfNeeded();
+#endif // defined(OS_MACOSX) && !defined(OS_IOS)
+#endif // USE_ATTACHMENT_BROKER
+
#if !defined(OS_IOS)
indexed_db_thread_.reset(new base::Thread("IndexedDB"));
indexed_db_thread_->Start();
« no previous file with comments | « content/browser/browser_child_process_host_impl.cc ('k') | content/browser/renderer_host/render_process_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698