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 18c29be0b1
commit e4cf82a28f
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

View File

@ -135,7 +135,7 @@ public:
LAYER_CLIENT_TYPE_GL = 2 // AndroidGeckoGLLayerClient
};
static void ConstructBridge(JNIEnv *jEnv, jclass jGeckoAppShellClass);
static void ConstructBridge(JNIEnv *jEnv);
static AndroidBridge *Bridge() {
return sBridge.get();
@ -442,7 +442,7 @@ protected:
AndroidBridge();
~AndroidBridge();
bool Init(JNIEnv *jEnv, jclass jGeckoApp);
bool Init(JNIEnv *jEnv);
bool mOpenedGraphicsLibraries;
void OpenGraphicsLibraries();

View File

@ -58,7 +58,7 @@ extern "C" {
NS_EXPORT void JNICALL
Java_org_mozilla_gecko_GeckoAppShell_nativeInit(JNIEnv *jenv, jclass jc)
{
AndroidBridge::ConstructBridge(jenv, jc);
AndroidBridge::ConstructBridge(jenv);
}
NS_EXPORT void JNICALL