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

Unified Diff: content/renderer/render_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/renderer/render_thread_impl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/render_thread_impl.cc
diff --git a/content/renderer/render_thread_impl.cc b/content/renderer/render_thread_impl.cc
index ef0fc88578b617fbc489495c12c427ec9c98fc66..72e6cc38503365ce9a66523e341dca164c49852c 100644
--- a/content/renderer/render_thread_impl.cc
+++ b/content/renderer/render_thread_impl.cc
@@ -611,6 +611,7 @@ RenderThreadImpl::RenderThreadImpl(
: ChildThreadImpl(Options::Builder()
.InBrowserProcess(params)
.UseMojoChannel(true)
+ .AutoStartMojoShellConnection(false)
.Build()),
renderer_scheduler_(std::move(scheduler)),
categorized_worker_pool_(new CategorizedWorkerPool()) {
@@ -622,7 +623,10 @@ RenderThreadImpl::RenderThreadImpl(
RenderThreadImpl::RenderThreadImpl(
std::unique_ptr<base::MessageLoop> main_message_loop,
std::unique_ptr<scheduler::RendererScheduler> scheduler)
- : ChildThreadImpl(Options::Builder().UseMojoChannel(true).Build()),
+ : ChildThreadImpl(Options::Builder()
+ .UseMojoChannel(true)
+ .AutoStartMojoShellConnection(false)
+ .Build()),
renderer_scheduler_(std::move(scheduler)),
main_message_loop_(std::move(main_message_loop)),
categorized_worker_pool_(new CategorizedWorkerPool()) {
@@ -726,6 +730,16 @@ void RenderThreadImpl::Init(
AddFilter((new ServiceWorkerContextMessageFilter())->GetFilter());
+#if defined(MOJO_SHELL_CLIENT) && defined(USE_AURA)
+ if (base::CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kUseMusInRenderer)) {
+ CreateRenderWidgetWindowTreeClientFactory(GetMojoShellConnection());
+ }
+#endif
+
+ // Must be called before RenderThreadStarted() below.
+ StartMojoShellConnection();
+
GetContentClient()->renderer()->RenderThreadStarted();
InitSkiaEventTracer();
@@ -987,15 +1001,6 @@ void RenderThreadImpl::Shutdown() {
lazy_tls.Pointer()->Set(nullptr);
}
-void RenderThreadImpl::AddConnectionFilters(MojoShellConnection* connection) {
-#if defined(MOJO_SHELL_CLIENT) && defined(USE_AURA)
- if (base::CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kUseMusInRenderer)) {
- CreateRenderWidgetWindowTreeClientFactory(connection);
- }
-#endif
-}
-
bool RenderThreadImpl::Send(IPC::Message* msg) {
// There are cases where we want to pump asynchronous messages while waiting
// synchronously for the replies to the message to be sent here. However, this
« no previous file with comments | « content/renderer/render_thread_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698