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

Unified Diff: mojo/services/native_viewport/native_viewport_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
« no previous file with comments | « content/browser/renderer_host/compositor_impl_android.cc ('k') | ui/gl/android/surface_texture.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/services/native_viewport/native_viewport_android.cc
diff --git a/mojo/services/native_viewport/native_viewport_android.cc b/mojo/services/native_viewport/native_viewport_android.cc
index 55b88c9f514ed53390c639a6cef94a59b22e9d6c..9eb80835479297a466f67e0762dec36b0fee0357 100644
--- a/mojo/services/native_viewport/native_viewport_android.cc
+++ b/mojo/services/native_viewport/native_viewport_android.cc
@@ -60,7 +60,13 @@ void NativeViewportAndroid::SurfaceCreated(JNIEnv* env,
jobject obj,
jobject jsurface) {
base::android::ScopedJavaLocalRef<jobject> protector(env, jsurface);
- window_ = ANativeWindow_fromSurface(env, jsurface);
+ // 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, jsurface);
+ }
delegate_->OnAcceleratedWidgetAvailable(window_);
}
« no previous file with comments | « content/browser/renderer_host/compositor_impl_android.cc ('k') | ui/gl/android/surface_texture.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698