diff options
Diffstat (limited to 'chromium/content/child/child_thread_impl.cc')
-rw-r--r-- | chromium/content/child/child_thread_impl.cc | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/chromium/content/child/child_thread_impl.cc b/chromium/content/child/child_thread_impl.cc index 9d3b69def68..78e5cd7958d 100644 --- a/chromium/content/child/child_thread_impl.cc +++ b/chromium/content/child/child_thread_impl.cc @@ -5,6 +5,8 @@ #include "content/child/child_thread_impl.h" #include <signal.h> + +#include <memory> #include <string> #include <utility> @@ -47,6 +49,7 @@ #include "content/common/child_process.mojom.h" #include "content/common/field_trial_recorder.mojom.h" #include "content/common/in_process_child_thread_params.h" +#include "content/common/mojo_core_library_support.h" #include "content/public/common/content_client.h" #include "content/public/common/content_features.h" #include "content/public/common/content_switches.h" @@ -570,16 +573,19 @@ void ChildThreadImpl::Init(const Options& options) { // IPC mode. mojo::ScopedMessagePipeHandle child_process_pipe; if (!IsInBrowserProcess()) { - scoped_refptr<base::SingleThreadTaskRunner> mojo_ipc_task_runner = - GetIOTaskRunner(); - if (base::FeatureList::IsEnabled(features::kMojoDedicatedThread)) { - mojo_ipc_thread_.StartWithOptions( - base::Thread::Options(base::MessagePumpType::IO, 0)); - mojo_ipc_task_runner = mojo_ipc_thread_.task_runner(); + // If using a shared Mojo Core library, IPC support is already initialized. + if (!IsMojoCoreSharedLibraryEnabled()) { + scoped_refptr<base::SingleThreadTaskRunner> mojo_ipc_task_runner = + GetIOTaskRunner(); + if (base::FeatureList::IsEnabled(features::kMojoDedicatedThread)) { + mojo_ipc_thread_.StartWithOptions( + base::Thread::Options(base::MessagePumpType::IO, 0)); + mojo_ipc_task_runner = mojo_ipc_thread_.task_runner(); + } + mojo_ipc_support_ = std::make_unique<mojo::core::ScopedIPCSupport>( + mojo_ipc_task_runner, + mojo::core::ScopedIPCSupport::ShutdownPolicy::FAST); } - mojo_ipc_support_.reset(new mojo::core::ScopedIPCSupport( - mojo_ipc_task_runner, - mojo::core::ScopedIPCSupport::ShutdownPolicy::FAST)); mojo::IncomingInvitation invitation = InitializeMojoIPCChannel(); child_process_pipe = invitation.ExtractMessagePipe(0); } else { |