Bug 959237 - Define GetVM, GetJNIEnv, and GetJNIForThread as infallible; r=blassey

Currently when either of these methods fail, we log something and rely on the calling code to null check. Since these failures are serious and likely unrecoverable, it's better to define these methods as infallible and just crash if they do fail.
This commit is contained in:
Jim Chen
2014-01-17 23:32:24 -06:00
parent 15d29504c5
commit d1f525e06a
10 changed files with 27 additions and 149 deletions

View File

@@ -968,10 +968,6 @@ nsJNIString::nsJNIString(jstring jstr, JNIEnv *jenv)
JNIEnv *jni = jenv;
if (!jni) {
jni = AndroidBridge::GetJNIEnv();
if (!jni) {
SetIsVoid(true);
return;
}
}
const jchar* jCharPtr = jni->GetStringChars(jstr, nullptr);