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

Unified Diff: android_webview/browser/browser_view_renderer.cc

Issue 271163002: aw: Fix lost invalidate while playing video (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: thread Created 6 years, 7 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 | android_webview/native/aw_contents.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: android_webview/browser/browser_view_renderer.cc
diff --git a/android_webview/browser/browser_view_renderer.cc b/android_webview/browser/browser_view_renderer.cc
index 2fc80229d695b718382f778f1c84ef7e48e0432e..cad7c5b96b7b331180b02aa2f79af3e91eff5daf 100644
--- a/android_webview/browser/browser_view_renderer.cc
+++ b/android_webview/browser/browser_view_renderer.cc
@@ -664,7 +664,10 @@ void BrowserViewRenderer::EnsureContinuousInvalidation(bool force_invalidate) {
if (throttle_fallback_tick)
return;
- block_invalidates_ = compositor_needs_continuous_invalidate_;
+ {
+ base::AutoLock lock(render_thread_lock_);
+ block_invalidates_ = compositor_needs_continuous_invalidate_;
+ }
// Unretained here is safe because the callback is cancelled when
// |fallback_tick_| is destroyed.
@@ -713,8 +716,21 @@ bool BrowserViewRenderer::CompositeSW(SkCanvas* canvas) {
}
void BrowserViewRenderer::DidComposite(bool force_invalidate) {
+ {
+ base::AutoLock lock(render_thread_lock_);
+ block_invalidates_ = false;
+ }
+
+ if (!ui_task_runner_->BelongsToCurrentThread()) {
+ ui_task_runner_->PostTask(
+ FROM_HERE,
+ base::Bind(&BrowserViewRenderer::EnsureContinuousInvalidation,
+ ui_thread_weak_ptr_,
+ force_invalidate));
+ return;
+ }
+
fallback_tick_.Cancel();
- block_invalidates_ = false;
EnsureContinuousInvalidation(force_invalidate);
}
« no previous file with comments | « no previous file | android_webview/native/aw_contents.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698