Bug 794981 - Part 2: Don't pass GeckoAppShell class to Init as a parameter - find it in the usual way. r=kats

This commit is contained in:
Chris Kitching
2013-09-09 08:57:36 -04:00
parent f123455a1a
commit 0247b949ec
3 changed files with 8 additions and 8 deletions

View File

@@ -61,8 +61,7 @@ class AndroidRefable {
static android::sp<AndroidRefable> (*android_SurfaceTexture_getNativeWindow)(JNIEnv* env, jobject surfaceTexture) = nullptr;
void
AndroidBridge::ConstructBridge(JNIEnv *jEnv,
jclass jGeckoAppShellClass)
AndroidBridge::ConstructBridge(JNIEnv *jEnv)
{
/* NSS hack -- bionic doesn't handle recursive unloads correctly,
* because library finalizer functions are called with the dynamic
@@ -75,15 +74,14 @@ AndroidBridge::ConstructBridge(JNIEnv *jEnv,
PR_NewThreadPrivateIndex(&sJavaEnvThreadIndex, JavaThreadDetachFunc);
AndroidBridge *bridge = new AndroidBridge();
if (!bridge->Init(jEnv, jGeckoAppShellClass)) {
if (!bridge->Init(jEnv)) {
delete bridge;
}
sBridge = bridge;
}
bool
AndroidBridge::Init(JNIEnv *jEnv,
jclass jGeckoAppShellClass)
AndroidBridge::Init(JNIEnv *jEnv)
{
ALOG_BRIDGE("AndroidBridge::Init");
jEnv->GetJavaVM(&mJavaVM);
@@ -98,6 +96,8 @@ AndroidBridge::Init(JNIEnv *jEnv,
mHasNativeWindowAccess = false;
mHasNativeWindowFallback = false;
jclass jGeckoAppShellClass = jEnv->FindClass("org/mozilla/gecko/GeckoAppShell");
mGeckoAppShellClass = (jclass) jEnv->NewGlobalRef(jGeckoAppShellClass);
#ifdef MOZ_WEBSMS_BACKEND