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

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: Fix build. 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 9b29b001e512ae50c1501f149c5832bc3e37f12a..c36d820f9dfcc58f788f8c2b46d2c5acaf74ef94 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)
@@ -117,6 +119,7 @@
#include "content/browser/bootstrap_sandbox_manager_mac.h"
#include "content/browser/cocoa/system_hotkey_helper_mac.h"
#include "content/browser/compositor/browser_compositor_view_mac.h"
+#include "content/browser/mach_broker_mac.h"
#include "content/browser/theme_helper_mac.h"
#include "ui/accelerated_widget_mac/window_resize_helper_mac.h"
#endif
@@ -1200,6 +1203,20 @@ int BrowserMainLoop::BrowserThreadsStarted() {
mojo_shell_context_.reset(new MojoShellContext);
#endif
+#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(
erikchen 2016/03/16 17:33:11 It's probably the case that this can just become C
+ MachBroker::GetInstance());
+ mojo::edk::SetMachPortProviderIfNeeded(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