Example #1
0
void
AndroidGeckoLayerClient::CreateFrame(AndroidLayerRendererFrame& aFrame)
{
    JNIEnv *env = GetJNIForThread();
    NS_ABORT_IF_FALSE(env, "No JNI environment at CreateFrame()!");
    if (!env) {
        return;
    }

    jobject frameJObj = env->CallObjectMethod(wrapped_obj, jCreateFrameMethod);
    NS_ABORT_IF_FALSE(frameJObj, "No frame object!");
    aFrame.Init(frameJObj);
}
Example #2
0
bool
AndroidGeckoLayerClient::CreateFrame(JNIEnv *env, AndroidLayerRendererFrame& aFrame)
{
    AutoLocalJNIFrame jniFrame(env, 1);

    jobject frameJObj = env->CallObjectMethod(wrapped_obj, jCreateFrameMethod);
    if (jniFrame.CheckForException())
        return false;
    NS_ABORT_IF_FALSE(frameJObj, "No frame object!");

    aFrame.Init(env, frameJObj);
    return true;
}
bool
AndroidGeckoLayerClient::CreateFrame(AutoLocalJNIFrame *jniFrame, AndroidLayerRendererFrame& aFrame)
{
    if (!jniFrame || !jniFrame->GetEnv())
        return false;

    jobject frameJObj = jniFrame->GetEnv()->CallObjectMethod(wrapped_obj, jCreateFrameMethod);
    if (jniFrame->CheckForException())
        return false;
    NS_ABORT_IF_FALSE(frameJObj, "No frame object!");

    aFrame.Init(jniFrame->GetEnv(), frameJObj);
    return true;
}