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

Unified Diff: content/app/android/child_process_service.cc

Issue 225283008: base: Add ScopedJavaLocalFrame class. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 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
« base/android/scoped_java_ref.cc ('K') | « base/android/scoped_java_ref.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/app/android/child_process_service.cc
diff --git a/content/app/android/child_process_service.cc b/content/app/android/child_process_service.cc
index 0a78803c026af47bac21374a1a16cceb9ed51f1a..e8c8e47af65c7ba793cc29f79870e96d22a0d165 100644
--- a/content/app/android/child_process_service.cc
+++ b/content/app/android/child_process_service.cc
@@ -72,8 +72,12 @@ class SurfaceTexturePeerChildImpl : public SurfaceTexturePeer,
if (surface.j_surface().is_null())
return NULL;
- ANativeWindow* native_window = ANativeWindow_fromSurface(
- env, surface.j_surface().obj());
+ // Note: This ensures that any local references used by
+ // ANativeWindow_fromSurface are released immediately.
+ base::android::ScopedJavaLocalFrame scoped_local_reference_frame(env);
+
+ ANativeWindow* native_window =
+ ANativeWindow_fromSurface(env, surface.j_surface().obj());
return native_window;
}
@@ -90,6 +94,10 @@ class SurfaceTexturePeerChildImpl : public SurfaceTexturePeer,
if (surface.j_surface().is_null())
return NULL;
+ // Note: This ensures that any local references used by
+ // ANativeWindow_fromSurface are released immediately.
+ base::android::ScopedJavaLocalFrame scoped_local_reference_frame(env);
reveman 2014/04/04 16:18:32 We might want to land this separately from the bas
+
ANativeWindow* native_window =
ANativeWindow_fromSurface(env, surface.j_surface().obj());
« base/android/scoped_java_ref.cc ('K') | « base/android/scoped_java_ref.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698