| Index: content/browser/renderer_host/render_process_host_impl.cc
|
| diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc
|
| index 9180fdb96308535a63953ba4822c2453529809f6..8de17e409548e7e74950ca875119f4fe51a39895 100644
|
| --- a/content/browser/renderer_host/render_process_host_impl.cc
|
| +++ b/content/browser/renderer_host/render_process_host_impl.cc
|
| @@ -153,6 +153,8 @@
|
| #include "gpu/command_buffer/client/gpu_switches.h"
|
| #include "gpu/command_buffer/common/gles2_cmd_utils.h"
|
| #include "gpu/command_buffer/service/gpu_switches.h"
|
| +#include "ipc/attachment_broker.h"
|
| +#include "ipc/attachment_broker_privileged.h"
|
| #include "ipc/ipc_channel.h"
|
| #include "ipc/ipc_logging.h"
|
| #include "ipc/ipc_switches.h"
|
| @@ -549,6 +551,14 @@ RenderProcessHostImpl::RenderProcessHostImpl(
|
| if (BootstrapSandboxManager::ShouldEnable())
|
| AddObserver(BootstrapSandboxManager::GetInstance());
|
| #endif
|
| +
|
| +#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.
|
| + IPC::AttachmentBrokerPrivileged::CreateBrokerIfNeeded();
|
| +#endif
|
| }
|
|
|
| // static
|
| @@ -651,6 +661,9 @@ bool RenderProcessHostImpl::Init() {
|
| const std::string channel_id =
|
| IPC::Channel::GenerateVerifiedChannelID(std::string());
|
| channel_ = CreateChannelProxy(channel_id);
|
| +#if USE_ATTACHMENT_BROKER
|
| + GetAttachmentBroker()->RegisterCommunicationChannel(channel_.get());
|
| +#endif
|
|
|
| // Setup the Mojo channel.
|
| mojo_application_host_->Init();
|
| @@ -1731,6 +1744,11 @@ void RenderProcessHostImpl::Cleanup() {
|
| #endif
|
| base::MessageLoop::current()->DeleteSoon(FROM_HERE, this);
|
| deleting_soon_ = true;
|
| +
|
| +#if USE_ATTACHMENT_BROKER
|
| + GetAttachmentBroker()->DeregisterCommunicationChannel(channel_.get());
|
| +#endif
|
| +
|
| // It's important not to wait for the DeleteTask to delete the channel
|
| // proxy. Kill it off now. That way, in case the profile is going away, the
|
| // rest of the objects attached to this RenderProcessHost start going
|
|
|