Cleans up Android-specific changes to WebCore/bridge/jni ready for upstreaing to webkit.org.

Change-Id: I0778955bee95680a9924fdae2967158e4add81ba
diff --git a/WebCore/bridge/jni/jni_class.cpp b/WebCore/bridge/jni/jni_class.cpp
index 0877e50..9c7f300 100644
--- a/WebCore/bridge/jni/jni_class.cpp
+++ b/WebCore/bridge/jni/jni_class.cpp
@@ -85,7 +85,8 @@
         methodList->append(aMethod);
         env->DeleteLocalRef(aJMethod);
     }    
-#ifdef ANDROID_FIX
+#if PLATFORM(ANDROID)
+    // TODO : Upstream to webkit.org for all platforms.
     env->DeleteLocalRef(fields);
     env->DeleteLocalRef(methods);
     env->DeleteLocalRef(aClass);
diff --git a/WebCore/bridge/jni/jni_instance.cpp b/WebCore/bridge/jni/jni_instance.cpp
index 0022196..e3b857d 100644
--- a/WebCore/bridge/jni/jni_instance.cpp
+++ b/WebCore/bridge/jni/jni_instance.cpp
@@ -26,12 +26,12 @@
 #include "config.h"
 #include "jni_instance.h"
 
-#ifdef ANDROID
+#if ENABLE(MAC_JAVA_BRIDGE)
+
+#if PLATFORM(ANDROID)
 #include <assert.h>
 #endif
 
-#if ENABLE(MAC_JAVA_BRIDGE)
-
 #include "jni_class.h"
 #include "jni_runtime.h"
 #include "jni_utility.h"
diff --git a/WebCore/bridge/jni/jni_runtime.cpp b/WebCore/bridge/jni/jni_runtime.cpp
index 2bac17a..50fe351 100644
--- a/WebCore/bridge/jni/jni_runtime.cpp
+++ b/WebCore/bridge/jni/jni_runtime.cpp
@@ -284,7 +284,8 @@
     jclass modifierClass = env->FindClass("java/lang/reflect/Modifier");
     int modifiers = callJNIMethod<jint>(aMethod, "getModifiers", "()I");
     _isStatic = (bool)callJNIStaticMethod<jboolean>(modifierClass, "isStatic", "(I)Z", modifiers);
-#ifdef ANDROID_FIX
+#if PLATFORM(ANDROID)
+    // TODO : Upstream to webkit.org for all platforms.
     env->DeleteLocalRef(modifierClass);
 #endif
 }
diff --git a/WebCore/bridge/jni/jni_utility.cpp b/WebCore/bridge/jni/jni_utility.cpp
index e57e475..e1eb736 100644
--- a/WebCore/bridge/jni/jni_utility.cpp
+++ b/WebCore/bridge/jni/jni_utility.cpp
@@ -28,6 +28,7 @@
 
 #if ENABLE(MAC_JAVA_BRIDGE)
 
+#if PLATFORM(ANDROID)
 #if USE(JSC)
 #include "jni_runtime.h"
 #include "runtime_array.h"
@@ -35,6 +36,7 @@
 #include <runtime/JSArray.h>
 #include <runtime/JSLock.h>
 #endif
+#endif
 
 #include <dlfcn.h>
 
@@ -350,6 +352,7 @@
     return result;
 }
 
+#if PLATFORM(ANDROID)
 #if USE(JSC)
 static jobject convertArrayInstanceToJavaArray(ExecState* exec, JSArray* jsArray, const char* javaClassName)
 {
@@ -581,6 +584,7 @@
     return result;
 }
 #endif  // USE(JSC)
+#endif  // PLATFORM(ANDROID)
 
 }  // end of namespace Bindings
 
diff --git a/WebCore/bridge/jni/jni_utility.h b/WebCore/bridge/jni/jni_utility.h
index 959330d..e46dbc4 100644
--- a/WebCore/bridge/jni/jni_utility.h
+++ b/WebCore/bridge/jni/jni_utility.h
@@ -28,10 +28,12 @@
 
 #if ENABLE(MAC_JAVA_BRIDGE)
 
+#include <JavaVM/jni.h>
+#if PLATFORM(ANDROID)
 #if USE(JSC)
 #include <runtime/JSValue.h>
 #endif
-#include <JavaVM/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
@@ -55,10 +57,12 @@
 
 namespace JSC {
 
+#if PLATFORM(ANDROID)
 #if USE(JSC)
 class ExecState;
 class JSObject;    
 #endif
+#endif
 
 namespace Bindings {
 
@@ -76,9 +80,11 @@
 JNIType JNITypeFromPrimitiveType(char type);
 const char *signatureFromPrimitiveType(JNIType type);
 
+#if PLATFORM(ANDROID)
 #if USE(JSC)
 jvalue convertValueToJValue(ExecState*, JSValue, JNIType, const char* javaClassName);
 #endif
+#endif
 
 jvalue getJNIField(jobject obj, JNIType type, const char *name, const char *signature);
 
@@ -222,7 +228,9 @@
             jmethodID mid = env->GetMethodID(cls, name, sig);
             if ( mid != NULL )
             {
-#ifdef ANDROID_FIX // Avoids references to cls without popping the local frame.
+#if PLATFORM(ANDROID)
+                // TODO : Upstream to webkit.org for all platforms.
+                // Avoids references to cls without popping the local frame.
                 env->DeleteLocalRef(cls);
 #endif
                 return JNICaller<T>::callV(obj, mid, args);
@@ -285,9 +293,12 @@
     
     return result;
 }
+    
+#if PLATFORM(ANDROID)
 #if USE(JSC)
 bool dispatchJNICall(ExecState*, const void* targetAppletView, jobject obj, bool isStatic, JNIType returnType, jmethodID methodID, jvalue* args, jvalue& result, const char* callingURL, JSValue& exceptionDescription);
 #endif
+#endif
 
 } // namespace Bindings