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

Unified Diff: ui/gl/android/surface_texture.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
« no previous file with comments | « mojo/services/native_viewport/native_viewport_android.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gl/android/surface_texture.cc
diff --git a/ui/gl/android/surface_texture.cc b/ui/gl/android/surface_texture.cc
index a580041f3b73941f2be2798908cf69f534453d42..3f55cbdaa75d990b286a00d51385f4c831b2cf59 100644
--- a/ui/gl/android/surface_texture.cc
+++ b/ui/gl/android/surface_texture.cc
@@ -123,6 +123,10 @@ void SurfaceTexture::DetachFromGLContext() {
ANativeWindow* SurfaceTexture::CreateSurface() {
JNIEnv* env = base::android::AttachCurrentThread();
ScopedJavaSurface surface(this);
+ // 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);
ANativeWindow* native_window = ANativeWindow_fromSurface(
env, surface.j_surface().obj());
return native_window;
« no previous file with comments | « mojo/services/native_viewport/native_viewport_android.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698