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

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: rebase 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..e71482a4a06d6c5711c020f9dc672f434d3b1867 100644
--- a/android_webview/browser/browser_view_renderer.cc
+++ b/android_webview/browser/browser_view_renderer.cc
@@ -664,6 +664,7 @@ void BrowserViewRenderer::EnsureContinuousInvalidation(bool force_invalidate) {
if (throttle_fallback_tick)
return;
+ base::AutoLock lock(render_thread_lock_);
block_invalidates_ = compositor_needs_continuous_invalidate_;
// Unretained here is safe because the callback is cancelled when
@@ -713,9 +714,21 @@ bool BrowserViewRenderer::CompositeSW(SkCanvas* canvas) {
}
void BrowserViewRenderer::DidComposite(bool force_invalidate) {
- fallback_tick_.Cancel();
- block_invalidates_ = false;
- EnsureContinuousInvalidation(force_invalidate);
+ {
+ base::AutoLock lock(render_thread_lock_);
+ fallback_tick_.Cancel();
mkosiba (inactive) 2014/05/12 14:29:51 this doesn't look threadsafe: from base/cancellab
boliu 2014/05/12 15:34:49 Hmm, good point. There is nothing protecting runni
+ block_invalidates_ = false;
+ }
+
+ if (ui_task_runner_->BelongsToCurrentThread()) {
+ EnsureContinuousInvalidation(force_invalidate);
+ return;
+ }
+ ui_task_runner_->PostTask(
+ FROM_HERE,
+ base::Bind(&BrowserViewRenderer::EnsureContinuousInvalidation,
+ ui_thread_weak_ptr_,
+ force_invalidate));
}
std::string BrowserViewRenderer::ToString(AwDrawGLInfo* draw_info) const {
« 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