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

Unified Diff: content/renderer/render_thread_impl.cc

Issue 2353003004: 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 09d716986497a07756e1691b4c47af983b16604d..624255932bb8e5029376ec847d479e84ca724a8d 100644
--- a/content/renderer/render_thread_impl.cc
+++ b/content/renderer/render_thread_impl.cc
@@ -225,7 +225,7 @@ namespace content {
namespace {
-const int64_t kInitialIdleHandlerDelayMs = 1000;
+ const int64_t kInitialIdleHandlerDelayMs = 1000;
const int64_t kLongIdleHandlerDelayMs = 30 * 1000;
#if defined(OS_ANDROID)
@@ -247,6 +247,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> >
@@ -569,10 +573,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