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

Unified Diff: content/browser/renderer_host/compositor_impl_android.cc

Issue 225283008: base: Add ScopedJavaLocalFrame class. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Set kDefaultLocalFrameCapacity to 16. 512 is much higher than necessary and might fail. Created 6 years, 8 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
Index: content/browser/renderer_host/compositor_impl_android.cc
diff --git a/content/browser/renderer_host/compositor_impl_android.cc b/content/browser/renderer_host/compositor_impl_android.cc
index db02a7c656a49acc3e231a7eef08414ea69c2b69..c472607b5061cac9819f57974a1d16b2f9883e72 100644
--- a/content/browser/renderer_host/compositor_impl_android.cc
+++ b/content/browser/renderer_host/compositor_impl_android.cc
@@ -361,8 +361,13 @@ void CompositorImpl::SetSurface(jobject surface) {
// Now, set the new surface if we have one.
ANativeWindow* window = NULL;
- if (surface)
+ if (surface) {
+ // Note: This ensures that any local references used by
+ // ANativeWindow_fromSurface are released immediately. This is needed as a
+ // workaround for https://code.google.com/p/android/issues/detail?id=68174
+ base::android::ScopedJavaLocalFrame scoped_local_reference_frame(env);
window = ANativeWindow_fromSurface(env, surface);
+ }
if (window) {
SetWindowSurface(window);
ANativeWindow_release(window);
« no previous file with comments | « content/app/android/child_process_service.cc ('k') | mojo/services/native_viewport/native_viewport_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698