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

Unified Diff: content/browser/browser_child_process_host_impl.cc

Issue 1414603003: ipc: Move AttachmentBrokerPrivileged singleton logic into ipc/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Minor formatting. Created 5 years, 2 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
« no previous file with comments | « no previous file | content/browser/renderer_host/render_process_host_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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));
« no previous file with comments | « no previous file | content/browser/renderer_host/render_process_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698