Index: base/android/scoped_java_ref.cc |
diff --git a/base/android/scoped_java_ref.cc b/base/android/scoped_java_ref.cc |
index 21b466e958423f52b6e5f5657a51056e0a146fbc..bb6f5032fe3454dfc2011c5a6a38c603714a84c5 100644 |
--- a/base/android/scoped_java_ref.cc |
+++ b/base/android/scoped_java_ref.cc |
@@ -9,6 +9,24 @@ |
namespace base { |
namespace android { |
+namespace { |
+ |
+const int kDefaultLocalFrameCapacity = 16; |
+ |
+} // namespace |
+ |
+ScopedJavaLocalFrame::ScopedJavaLocalFrame(JNIEnv* env) : env_(env) { |
+ int failed = env_->PushLocalFrame(kDefaultLocalFrameCapacity); |
+ DCHECK(!failed); |
+} |
+ |
+ScopedJavaLocalFrame::ScopedJavaLocalFrame(JNIEnv* env, int capacity) |
+ : env_(env) { |
+ int failed = env_->PushLocalFrame(capacity); |
+ DCHECK(!failed); |
+} |
+ |
+ScopedJavaLocalFrame::~ScopedJavaLocalFrame() { env_->PopLocalFrame(NULL); } |
JavaRef<jobject>::JavaRef() : obj_(NULL) {} |