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

Unified Diff: base/android/jni_android.cc

Issue 128473003: Merge 243367 "Revert "android: Add CHECK() calls to better under..." (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1750/src/
Patch Set: Created 6 years, 11 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/android/jni_android.cc
===================================================================
--- base/android/jni_android.cc (revision 243575)
+++ base/android/jni_android.cc (working copy)
@@ -17,10 +17,6 @@
using base::android::ScopedJavaLocalRef;
JavaVM* g_jvm = NULL;
-
-// NOTE: This variable is only used for debugging http://crbug.com/322200
-const JNIInvokeInterface* g_jvm_functions = NULL;
-
// Leak the global app context, as it is used from a non-joinable worker thread
// that may still be running at shutdown. There is no harm in doing this.
base::LazyInstance<base::android::ScopedJavaGlobalRef<jobject> >::Leaky
@@ -80,10 +76,7 @@
JNIEnv* AttachCurrentThread() {
DCHECK(g_jvm);
JNIEnv* env = NULL;
- // See http://crbug.com/322200 for the reasons for these CHECKs.
- CHECK(g_jvm);
- CHECK_EQ(g_jvm_functions, g_jvm->functions);
- jint ret = g_jvm_functions->AttachCurrentThread(g_jvm, &env, NULL);
+ jint ret = g_jvm->AttachCurrentThread(&env, NULL);
DCHECK_EQ(JNI_OK, ret);
return env;
}
@@ -91,18 +84,13 @@
void DetachFromVM() {
// Ignore the return value, if the thread is not attached, DetachCurrentThread
// will fail. But it is ok as the native thread may never be attached.
- if (g_jvm) {
- // See http://crbug.com/322200 for the reasons for these CHECKs.
- CHECK(g_jvm);
- CHECK_EQ(g_jvm_functions, g_jvm->functions);
+ if (g_jvm)
g_jvm->DetachCurrentThread();
- }
}
void InitVM(JavaVM* vm) {
DCHECK(!g_jvm);
g_jvm = vm;
- g_jvm_functions = vm->functions;
}
bool IsVMInitialized() {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698