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

Unified Diff: content/child/child_thread_impl.cc

Issue 2137303002: Allow ChildThreadImpl subclasses to manually start MojoShellConnection (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 5 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 | « content/child/child_thread_impl.h ('k') | content/renderer/render_thread_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « content/child/child_thread_impl.h ('k') | content/renderer/render_thread_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698