summaryrefslogtreecommitdiffstats
path: root/base
diff options
context:
space:
mode:
authoravayvod@chromium.org <avayvod@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-10-09 19:43:10 +0000
committeravayvod@chromium.org <avayvod@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-10-09 19:43:10 +0000
commit7a3b0e489006c81b4586b362e020d671ed72fc48 (patch)
tree43b2d4697a123701d0f5581a02c7bc89c68b4e8e /base
parent57e87c2879f14bb8d304abd6c41c3221a77e25af (diff)
downloadchromium_src-7a3b0e489006c81b4586b362e020d671ed72fc48.zip
chromium_src-7a3b0e489006c81b4586b362e020d671ed72fc48.tar.gz
chromium_src-7a3b0e489006c81b4586b362e020d671ed72fc48.tar.bz2
Upstream base/android/jni_android.cc
Original change descriptions: - make JNIAndroidTest work with --gtest_repeat - add java exception info to breakpad - add JniArray test BUG=136707 TEST=Built and run jni_android_unittests.cc Review URL: https://chromiumcodereview.appspot.com/11090022 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@160895 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base')
-rw-r--r--base/android/jni_android.cc9
-rw-r--r--base/base.gyp1
2 files changed, 5 insertions, 5 deletions
diff --git a/base/android/jni_android.cc b/base/android/jni_android.cc
index a34bc18..0173793 100644
--- a/base/android/jni_android.cc
+++ b/base/android/jni_android.cc
@@ -52,8 +52,7 @@ JavaVM* g_jvm = NULL;
// that may still be running at shutdown. There is no harm in doing this.
base::LazyInstance<base::android::ScopedJavaGlobalRef<jobject> >::Leaky
g_application_context = LAZY_INSTANCE_INITIALIZER;
-base::LazyInstance<MethodIDMap>::Leaky
- g_method_id_map = LAZY_INSTANCE_INITIALIZER;
+base::LazyInstance<MethodIDMap> g_method_id_map = LAZY_INSTANCE_INITIALIZER;
std::string GetJavaExceptionInfo(JNIEnv* env, jthrowable java_throwable) {
ScopedJavaLocalRef<jclass> throwable_clazz =
@@ -132,11 +131,10 @@ namespace base {
namespace android {
JNIEnv* AttachCurrentThread() {
- if (!g_jvm)
- return NULL;
+ DCHECK(g_jvm);
JNIEnv* env = NULL;
jint ret = g_jvm->AttachCurrentThread(&env, NULL);
- DCHECK_EQ(ret, JNI_OK);
+ DCHECK_EQ(JNI_OK, ret);
return env;
}
@@ -349,6 +347,7 @@ void CheckException(JNIEnv* env) {
}
// Clear the pending exception, since a local reference is now held.
+ env->ExceptionDescribe();
env->ExceptionClear();
// Set the exception_string in BuildInfo so that breakpad can read it.
diff --git a/base/base.gyp b/base/base.gyp
index 987eae1..eb2429b 100644
--- a/base/base.gyp
+++ b/base/base.gyp
@@ -368,6 +368,7 @@
'sources': [
# Tests.
'android/jni_android_unittest.cc',
+ 'android/jni_array_unittest.cc',
'android/path_utils_unittest.cc',
'android/scoped_java_ref_unittest.cc',
'at_exit_unittest.cc',