Changeset 116405 in webkit
- Timestamp:
- May 8, 2012 2:00:08 AM (12 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r116403 r116405 1 2012-05-08 Adam Barth <abarth@webkit.org> 2 3 OS(ANDROID) JNI AttachCurrentThread take JNIEnv** as a parameter, not void** 4 https://bugs.webkit.org/show_bug.cgi?id=85869 5 6 Reviewed by Eric Seidel. 7 8 According to 9 http://docs.oracle.com/javase/1.5.0/docs/guide/jni/spec/invocation.html, 10 AttachCurrentThread takes a JNIEnv** rather than a void**. Apparently, 11 most implementations actually take a void**. The OS(ANDROID) 12 implementation, however, actually takes an JNIEnv**. This patch 13 introduces a typedef to give each implementation what it desires. 14 15 * bridge/jni/JNIUtility.cpp: 16 (JSC::Bindings::getJNIEnv): 17 1 18 2012-05-08 Balazs Kelemen <kbalazs@webkit.org> 2 19 -
trunk/Source/WebCore/bridge/jni/JNIUtility.cpp
r104406 r116405 83 83 } 84 84 85 // JDK 1.0 mistakenly declared the first parameter to AttachCurrentThread as 86 // void** rather than as JNIEnv**. This quirk appears to have been carried 87 // forward in implementations of Java despite what the documentation says. 88 // On OS(ANDROID), however, AttachCurrentThread appears to follow the 89 // documentation and expects a JNIEnv** parameter. The following typedef should 90 // give each implementation what it desires. 91 #if OS(ANDROID) 92 typedef JNIEnv* JNIEnvDummy; 93 #else 94 typedef void* JNIEnvDummy; 95 #endif 96 85 97 JNIEnv* getJNIEnv() 86 98 { 87 99 union { 88 100 JNIEnv* env; 89 void*dummy;101 JNIEnvDummy dummy; 90 102 } u; 91 103 jint jniError = 0;
Note: See TracChangeset
for help on using the changeset viewer.