Back to index

lightning-sunbird  0.9+nobinonly
Functions
ProxyClassLoader.h File Reference
#include "jni.h"
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

jclass ProxyFindClass (JNIEnv *env, const char *name)

Function Documentation

jclass ProxyFindClass ( JNIEnv env,
const char *  name 
)

Definition at line 194 of file ProxyClassLoader.cpp.

{
    do {
        // TODO:  prevent recursive call to ProxyFindClass, if netscape.oji.ProxyClassLoader
        // isn't found by getScriptClassLoader().
        jobject classloader;
        jthrowable jException = env->ExceptionOccurred();
        if (jException != NULL) {
            // Clean up exception
            env->ExceptionClear();
            // Release local ref
            env->DeleteLocalRef(jException);
        }
        nsresult rv = getScriptClassLoader(env, &classloader);
        if (NS_FAILED(rv)) break;

        jclass netscape_oji_ProxyClassLoader = env->GetObjectClass(classloader);
        jmethodID loadClassID = env->GetMethodID(netscape_oji_ProxyClassLoader, "loadClass",
                                                 "(Ljava/lang/String;)Ljava/lang/Class;");
        env->DeleteLocalRef(netscape_oji_ProxyClassLoader);
        if (!loadClassID) {
            env->ExceptionClear();
            break;
        }
        jstring jname = env->NewStringUTF(name);
        jvalue jargs[1]; jargs[0].l = jname;
        jclass c = (jclass) env->CallObjectMethodA(classloader, loadClassID, jargs);
        env->DeleteLocalRef(jname);
        return c;
    } while (0);
    return 0;
}

Here is the call graph for this function:

Here is the caller graph for this function: