widget/android/AndroidJNIWrapper.h

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

michael@0 1 /* -*- Mode: c++; c-basic-offset: 4; tab-width: 20; indent-tabs-mode: nil; -*-
michael@0 2 * This Source Code Form is subject to the terms of the Mozilla Public
michael@0 3 * License, v. 2.0. If a copy of the MPL was not distributed with this
michael@0 4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
michael@0 5
michael@0 6 #ifndef AndroidJNIWrapper_h__
michael@0 7 #define AndroidJNIWrapper_h__
michael@0 8
michael@0 9 #include <jni.h>
michael@0 10 #include <android/log.h>
michael@0 11
michael@0 12 extern "C" jclass jsjni_FindClass(const char *className);
michael@0 13
michael@0 14 /**
michael@0 15 * JNIEnv::FindClass alternative.
michael@0 16 * Callable from any thread, including code
michael@0 17 * invoked via the JNI that doesn't have MOZILLA_INTERNAL_API defined.
michael@0 18 * The caller is responsible for ensuring that the class is not leaked by
michael@0 19 * calling DeleteGlobalRef at an appropriate time.
michael@0 20 */
michael@0 21 extern "C" jclass jsjni_GetGlobalClassRef(const char *className);
michael@0 22
michael@0 23 extern "C" jmethodID jsjni_GetStaticMethodID(jclass methodClass,
michael@0 24 const char *methodName,
michael@0 25 const char *signature);
michael@0 26 extern "C" bool jsjni_ExceptionCheck();
michael@0 27 extern "C" void jsjni_CallStaticVoidMethodA(jclass cls, jmethodID method, jvalue *values);
michael@0 28 extern "C" int jsjni_CallStaticIntMethodA(jclass cls, jmethodID method, jvalue *values);
michael@0 29 extern "C" jobject jsjni_GetGlobalContextRef();
michael@0 30 extern "C" JavaVM* jsjni_GetVM();
michael@0 31 extern "C" JNIEnv* jsjni_GetJNIForThread();
michael@0 32
michael@0 33 #endif /* AndroidJNIWrapper_h__ */

mercurial