| Index: content/child/child_thread_impl.cc
|
| diff --git a/content/child/child_thread_impl.cc b/content/child/child_thread_impl.cc
|
| index d388d33398e4003c9680ae489e28a9d01c4d774d..bfd7c6b82b014a5139dbbec13c5289650b44413f 100644
|
| --- a/content/child/child_thread_impl.cc
|
| +++ b/content/child/child_thread_impl.cc
|
| @@ -265,7 +265,8 @@ ChildThreadImpl::Options::Options()
|
| : channel_name(base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
|
| switches::kProcessChannelID)),
|
| use_mojo_channel(base::CommandLine::ForCurrentProcess()->HasSwitch(
|
| - switches::kMojoChannelToken)) {
|
| + switches::kMojoChannelToken)),
|
| + auto_start_mojo_shell_connection(true) {
|
| }
|
|
|
| ChildThreadImpl::Options::Options(const Options& other) = default;
|
| @@ -293,6 +294,13 @@ ChildThreadImpl::Options::Builder::UseMojoChannel(bool use_mojo_channel) {
|
| }
|
|
|
| ChildThreadImpl::Options::Builder&
|
| +ChildThreadImpl::Options::Builder::AutoStartMojoShellConnection(
|
| + bool auto_start) {
|
| + options_.auto_start_mojo_shell_connection = auto_start;
|
| + return *this;
|
| +}
|
| +
|
| +ChildThreadImpl::Options::Builder&
|
| ChildThreadImpl::Options::Builder::WithChannelName(
|
| const std::string& channel_name) {
|
| options_.channel_name = channel_name;
|
| @@ -429,8 +437,8 @@ void ChildThreadImpl::Init(const Options& options) {
|
| mojo_shell_connection_->SetupInterfaceRequestProxies(
|
| GetInterfaceRegistry(), GetRemoteInterfaces());
|
|
|
| - AddConnectionFilters(mojo_shell_connection_.get());
|
| - mojo_shell_connection_->Start();
|
| + if (options.auto_start_mojo_shell_connection)
|
| + StartMojoShellConnection();
|
| }
|
|
|
| sync_message_filter_ = channel_->CreateSyncMessageFilter();
|
| @@ -696,7 +704,10 @@ bool ChildThreadImpl::OnMessageReceived(const IPC::Message& msg) {
|
| return router_.OnMessageReceived(msg);
|
| }
|
|
|
| -void ChildThreadImpl::AddConnectionFilters(MojoShellConnection* connection) {}
|
| +void ChildThreadImpl::StartMojoShellConnection() {
|
| + DCHECK(mojo_shell_connection_);
|
| + mojo_shell_connection_->Start();
|
| +}
|
|
|
| bool ChildThreadImpl::OnControlMessageReceived(const IPC::Message& msg) {
|
| return false;
|
|
|