widget/android/AndroidJNIWrapper.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/widget/android/AndroidJNIWrapper.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,33 @@
     1.4 +/* -*- Mode: c++; c-basic-offset: 4; tab-width: 20; indent-tabs-mode: nil; -*-
     1.5 + * This Source Code Form is subject to the terms of the Mozilla Public
     1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.8 +
     1.9 +#ifndef AndroidJNIWrapper_h__
    1.10 +#define AndroidJNIWrapper_h__
    1.11 +
    1.12 +#include <jni.h>
    1.13 +#include <android/log.h>
    1.14 +
    1.15 +extern "C" jclass jsjni_FindClass(const char *className);
    1.16 +
    1.17 +/**
    1.18 + * JNIEnv::FindClass alternative.
    1.19 + * Callable from any thread, including code
    1.20 + * invoked via the JNI that doesn't have MOZILLA_INTERNAL_API defined.
    1.21 + * The caller is responsible for ensuring that the class is not leaked by
    1.22 + * calling DeleteGlobalRef at an appropriate time.
    1.23 + */
    1.24 +extern "C" jclass jsjni_GetGlobalClassRef(const char *className);
    1.25 +
    1.26 +extern "C" jmethodID jsjni_GetStaticMethodID(jclass methodClass,
    1.27 +                                       const char *methodName,
    1.28 +                                       const char *signature);
    1.29 +extern "C" bool jsjni_ExceptionCheck();
    1.30 +extern "C" void jsjni_CallStaticVoidMethodA(jclass cls, jmethodID method, jvalue *values);
    1.31 +extern "C" int jsjni_CallStaticIntMethodA(jclass cls, jmethodID method, jvalue *values);
    1.32 +extern "C" jobject jsjni_GetGlobalContextRef();
    1.33 +extern "C" JavaVM* jsjni_GetVM();
    1.34 +extern "C" JNIEnv* jsjni_GetJNIForThread();
    1.35 +
    1.36 +#endif /* AndroidJNIWrapper_h__ */

mercurial