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

Unified Diff: content/renderer/render_thread_impl.cc

Issue 2363573002: Move ViewHostMsg_CreateWindow to mojom (Closed)
Patch Set: . Created 4 years, 3 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') | content/renderer/render_view_impl.cc » ('j') | 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 81605209e52e373ec6d972d44b5b8c842c8b6b65..3f1be5e03e5178292a065b699ccc6d052cb89874 100644
--- a/content/renderer/render_thread_impl.cc
+++ b/content/renderer/render_thread_impl.cc
@@ -248,6 +248,10 @@ const size_t kImageCacheSingleAllocationByteLimit = 64 * 1024 * 1024;
// Unique identifier for each output surface created.
uint32_t g_next_compositor_frame_sink_id = 1;
+// An implementation of mojom::RenderMessageFilter which can be mocked out
+// for tests which may indirectly send messages over this interface.
+mojom::RenderMessageFilter* g_render_message_filter_for_testing;
+
// Keep the global RenderThreadImpl in a TLS slot so it is impossible to access
// incorrectly from the wrong thread.
base::LazyInstance<base::ThreadLocalPointer<RenderThreadImpl> >
@@ -570,10 +574,25 @@ RenderThreadImpl* RenderThreadImpl::Create(
std::move(renderer_scheduler));
}
+// static
RenderThreadImpl* RenderThreadImpl::current() {
return lazy_tls.Pointer()->Get();
}
+// static
+mojom::RenderMessageFilter* RenderThreadImpl::current_render_message_filter() {
+ if (g_render_message_filter_for_testing)
+ return g_render_message_filter_for_testing;
+ DCHECK(current());
+ return current()->render_message_filter();
+}
+
+// static
+void RenderThreadImpl::SetRenderMessageFilterForTesting(
+ mojom::RenderMessageFilter* render_message_filter) {
+ g_render_message_filter_for_testing = render_message_filter;
+}
+
RenderThreadImpl::RenderThreadImpl(
const InProcessChildThreadParams& params,
std::unique_ptr<blink::scheduler::RendererScheduler> scheduler,
« no previous file with comments | « content/renderer/render_thread_impl.h ('k') | content/renderer/render_view_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698