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(); |