Index: content/browser/browser_child_process_host_impl.cc |
diff --git a/content/browser/browser_child_process_host_impl.cc b/content/browser/browser_child_process_host_impl.cc |
index 2f9076f0fa4a05487c2fa5c29817c5e6ebb78668..9a4ab0b2facafddf49cd2bdf0c319ee38c88fbef 100644 |
--- a/content/browser/browser_child_process_host_impl.cc |
+++ b/content/browser/browser_child_process_host_impl.cc |
@@ -30,6 +30,8 @@ |
#include "content/public/common/content_switches.h" |
#include "content/public/common/process_type.h" |
#include "content/public/common/result_codes.h" |
+#include "ipc/attachment_broker.h" |
+#include "ipc/attachment_broker_privileged.h" |
#if defined(OS_MACOSX) |
#include "content/browser/mach_broker_mac.h" |
@@ -117,6 +119,19 @@ BrowserChildProcessHostImpl::BrowserChildProcessHostImpl( |
power_monitor_message_broadcaster_(this) { |
data_.id = ChildProcessHostImpl::GenerateChildProcessUniqueId(); |
+#if USE_ATTACHMENT_BROKER |
+ // Construct the privileged attachment broker early in the life cycle of a |
+ // child process. 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 |
+ |
child_process_host_.reset(ChildProcessHost::Create(this)); |
AddFilter(new TraceMessageFilter(data_.id)); |
AddFilter(new ProfilerMessageFilter(process_type)); |