summaryrefslogtreecommitdiffstats
path: root/Source/WebCore/bridge/jni/JNIUtility.h
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebCore/bridge/jni/JNIUtility.h')
-rw-r--r--Source/WebCore/bridge/jni/JNIUtility.h35
1 files changed, 7 insertions, 28 deletions
diff --git a/Source/WebCore/bridge/jni/JNIUtility.h b/Source/WebCore/bridge/jni/JNIUtility.h
index 7b5d37c..508a2e5 100644
--- a/Source/WebCore/bridge/jni/JNIUtility.h
+++ b/Source/WebCore/bridge/jni/JNIUtility.h
@@ -28,36 +28,14 @@
#if ENABLE(JAVA_BRIDGE)
+#include "JavaType.h"
+
#if OS(MAC_OS_X)
#include <JavaVM/jni.h>
#else
#include <jni.h>
#endif
-// The order of these items can not be modified as they are tightly
-// bound with the JVM on Mac OSX. If new types need to be added, they
-// should be added to the end. It is used in jni_obc.mm when calling
-// through to the JVM. Newly added items need to be made compatible
-// in that file.
-//
-// TODO: Strictly, these are not JNI types but simply Java types. The type
-// conversion logic used here needs improving and this enum will likely be
-// changed at that time. See https://bugs.webkit.org/show_bug.cgi?id=38745
-typedef enum {
- invalid_type = 0,
- void_type,
- object_type,
- boolean_type,
- byte_type,
- char_type,
- short_type,
- int_type,
- long_type,
- float_type,
- double_type,
- array_type
-} JNIType;
-
namespace JSC {
namespace Bindings {
@@ -70,11 +48,12 @@ void releaseCharactersForJStringInEnv(JNIEnv*, jstring, const char*);
const jchar* getUCharactersFromJStringInEnv(JNIEnv*, jstring);
void releaseUCharactersForJStringInEnv(JNIEnv*, jstring, const jchar*);
-JNIType JNITypeFromClassName(const char* name);
-JNIType JNITypeFromPrimitiveType(char type);
-const char* signatureFromPrimitiveType(JNIType);
+JavaType javaTypeFromClassName(const char* name);
+JavaType javaTypeFromPrimitiveType(char type);
+const char* signatureFromJavaType(JavaType);
-jvalue getJNIField(jobject, JNIType, const char* name, const char* signature);
+jvalue getJNIField(jobject, JavaType, const char* name, const char* signature);
+jvalue callJNIMethod(jobject, JavaType returnType, const char* name, const char* signature, jvalue* args);
jmethodID getMethodID(jobject, const char* name, const char* sig);
JNIEnv* getJNIEnv();