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

Unified Diff: content/renderer/render_thread_impl.cc

Issue 2111353002: Move content's shell connections to the IO thread (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase 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
Index: content/renderer/render_thread_impl.cc
diff --git a/content/renderer/render_thread_impl.cc b/content/renderer/render_thread_impl.cc
index 660b52bedbb249e4e9c8877f6dd009aa38083e2b..ef0fc88578b617fbc489495c12c427ec9c98fc66 100644
--- a/content/renderer/render_thread_impl.cc
+++ b/content/renderer/render_thread_impl.cc
@@ -142,6 +142,8 @@
#include "net/base/port_util.h"
#include "net/base/registry_controlled_domains/registry_controlled_domain.h"
#include "net/base/url_util.h"
+#include "services/shell/public/cpp/interface_provider.h"
+#include "services/shell/public/cpp/interface_registry.h"
#include "skia/ext/event_tracer_impl.h"
#include "skia/ext/skia_memory_dump_provider.h"
#include "third_party/WebKit/public/platform/WebImageGenerator.h"
@@ -849,15 +851,6 @@ void RenderThreadImpl::Init(
GetInterfaceRegistry()->AddInterface(base::Bind(CreateFrameFactory));
GetInterfaceRegistry()->AddInterface(base::Bind(CreateEmbeddedWorkerSetup));
-#if defined(MOJO_SHELL_CLIENT) && defined(USE_AURA)
- // We may not have a MojoShellConnection object in tests that directly
- // instantiate a RenderThreadImpl.
- if (MojoShellConnection::GetForProcess() &&
- base::CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kUseMusInRenderer))
- CreateRenderWidgetWindowTreeClientFactory();
-#endif
-
GetRemoteInterfaces()->GetInterface(
mojo::GetProxy(&storage_partition_service_));
@@ -994,6 +987,15 @@ 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

Powered by Google App Engine
This is Rietveld 408576698