| Index: content/common/child_process_host_impl.cc
|
| diff --git a/content/common/child_process_host_impl.cc b/content/common/child_process_host_impl.cc
|
| index 71b5d6e29b102bccbb11bb3f0877c964b0ade05d..a2fb3fa44f9cebe193533530cfd5a298666f1b1a 100644
|
| --- a/content/common/child_process_host_impl.cc
|
| +++ b/content/common/child_process_host_impl.cc
|
| @@ -10,7 +10,6 @@
|
| #include "base/command_line.h"
|
| #include "base/files/file_path.h"
|
| #include "base/hash.h"
|
| -#include "base/lazy_instance.h"
|
| #include "base/logging.h"
|
| #include "base/metrics/histogram.h"
|
| #include "base/numerics/safe_math.h"
|
| @@ -26,6 +25,7 @@
|
| #include "content/public/common/content_paths.h"
|
| #include "content/public/common/content_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/message_filter.h"
|
| @@ -38,33 +38,6 @@
|
|
|
| namespace {
|
|
|
| -#if USE_ATTACHMENT_BROKER
|
| -// This class is wrapped in a singleton to ensure that its constructor is only
|
| -// called once. The constructor creates an attachment broker and
|
| -// sets it as the global broker.
|
| -class AttachmentBrokerWrapper {
|
| - public:
|
| - AttachmentBrokerWrapper() {
|
| - attachment_broker_.reset(
|
| - IPC::AttachmentBrokerPrivileged::CreateBroker().release());
|
| - }
|
| -
|
| - IPC::AttachmentBrokerPrivileged* GetAttachmentBroker() {
|
| - return attachment_broker_.get();
|
| - }
|
| -
|
| - private:
|
| - scoped_ptr<IPC::AttachmentBrokerPrivileged> attachment_broker_;
|
| -};
|
| -
|
| -base::LazyInstance<AttachmentBrokerWrapper>::Leaky
|
| - g_attachment_broker_wrapper = LAZY_INSTANCE_INITIALIZER;
|
| -
|
| -IPC::AttachmentBrokerPrivileged* GetAttachmentBroker() {
|
| - return g_attachment_broker_wrapper.Get().GetAttachmentBroker();
|
| -}
|
| -#endif // USE_ATTACHMENT_BROKER
|
| -
|
| // Global atomic to generate child process unique IDs.
|
| base::StaticAtomicSequenceNumber g_unique_id;
|
|
|
| @@ -117,7 +90,7 @@ ChildProcessHostImpl::ChildProcessHostImpl(ChildProcessHostDelegate* delegate)
|
| // 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.
|
| - GetAttachmentBroker();
|
| + IPC::AttachmentBrokerPrivileged::CreateBrokerIfNeeded();
|
| #endif
|
| }
|
|
|
|
|