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

Unified Diff: content/renderer/render_thread_impl.cc

Issue 24234002: Use IO loop for the compositor and media threads in the renderer on posix. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: also do the media thread Created 7 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 | « no previous file | 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 99cb1a1c1a2d79079fe38ccedce61dd2064c0fed..671e14c612a762ffc3aa64f889530e1f03495064 100644
--- a/content/renderer/render_thread_impl.cc
+++ b/content/renderer/render_thread_impl.cc
@@ -669,7 +669,18 @@ void RenderThreadImpl::EnsureWebKitInitialized() {
#endif
if (!compositor_message_loop_proxy_.get()) {
compositor_thread_.reset(new base::Thread("Compositor"));
+#if defined(OS_POSIX)
+ // Workaround for crbug.com/293736
+ // On Posix, MessagePumpDefault uses system time, so delayed tasks (for
+ // compositor scheduling) work incorrectly across system time changes
+ // (e.g. tlsdate). So instead, use an IO loop, which uses libevent, that
+ // uses monotonic time (immune to these problems).
+ base::Thread::Options options;
+ options.message_loop_type = base::MessageLoop::TYPE_IO;
+ compositor_thread_->StartWithOptions(options);
+#else
compositor_thread_->Start();
+#endif
#if defined(OS_ANDROID)
compositor_thread_->SetPriority(base::kThreadPriority_Display);
#endif
@@ -1294,7 +1305,18 @@ RenderThreadImpl::GetMediaThreadMessageLoopProxy() {
DCHECK(message_loop() == base::MessageLoop::current());
if (!media_thread_) {
media_thread_.reset(new base::Thread("Media"));
+#if defined(OS_POSIX)
+ // Workaround for crbug.com/293736
+ // On Posix, MessagePumpDefault uses system time, so delayed tasks (for
+ // compositor scheduling) work incorrectly across system time changes
+ // (e.g. tlsdate). So instead, use an IO loop, which uses libevent, that
+ // uses monotonic time (immune to these problems).
+ base::Thread::Options options;
+ options.message_loop_type = base::MessageLoop::TYPE_IO;
+ media_thread_->StartWithOptions(options);
+#else
media_thread_->Start();
+#endif
}
return media_thread_->message_loop_proxy();
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698