summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteve Block <steveblock@google.com>2010-01-21 19:08:14 +0000
committerSteve Block <steveblock@google.com>2010-01-27 16:06:32 +0000
commit4aeef553983e9d7a42b18646498bbd4b5a1c8c0a (patch)
tree59581fd46b666a6a37a024c1dcc16e4a74b11b25
parented2f5b0c199158ed3dc87410b9cb5cb89964f6c3 (diff)
downloadexternal_webkit-4aeef553983e9d7a42b18646498bbd4b5a1c8c0a.zip
external_webkit-4aeef553983e9d7a42b18646498bbd4b5a1c8c0a.tar.gz
external_webkit-4aeef553983e9d7a42b18646498bbd4b5a1c8c0a.tar.bz2
V8 can now use WebCore/bridge/jni/JNIBridge.h
JNIBridge.h is now used by both JSC and V8 $ diff WebCore/bridge/jni/JNIBridge.h V8Binding/jni/jni_runtime.h 2d1 < * Copyright (C) 2003, 2004, 2005, 2007, 2009, 2010 Apple Inc. All rights reserved. 27,30c26,27 < #ifndef JNIBridge_h < #define JNIBridge_h < < #if ENABLE(MAC_JAVA_BRIDGE) --- > #ifndef jni_runtime_h > #define jni_runtime_h 31a29 > #include "Bridge.h" 34,35c32,33 < #if USE(JSC) < #include "JavaStringJSC.h" --- > #if USE(V8) > #include "JavaStringV8.h" 64,66d61 < #if USE(JSC) < operator UString() const { return m_impl.uString(); } < #endif 118,120c113 < #endif // ENABLE(MAC_JAVA_BRIDGE) < < #endif // JNIBridge_h --- > #endif // jni_runtime_h Change-Id: I59c7dafb295aa7c81e79283333266c3f9f5a9a52
-rw-r--r--Android.mk6
-rw-r--r--V8Binding/jni/jni_runtime.cpp2
-rw-r--r--V8Binding/jni/jni_runtime.h113
-rw-r--r--WebCore/Android.v8bindings.mk2
-rw-r--r--WebCore/bridge/jni/JNIBridge.h5
-rw-r--r--WebCore/bridge/jni/v8/JNIBridgeV8.h4
-rw-r--r--WebCore/bridge/jni/v8/JNIUtilityPrivate.cpp2
-rw-r--r--WebCore/bridge/jni/v8/JavaClassV8.cpp2
-rw-r--r--WebCore/bridge/jni/v8/JavaInstanceV8.cpp2
-rw-r--r--WebCore/bridge/jni/v8/JavaNPObjectV8.cpp1
-rw-r--r--WebCore/bridge/jni/v8/JavaNPObjectV8.h2
11 files changed, 13 insertions, 128 deletions
diff --git a/Android.mk b/Android.mk
index 58a4bb6..e24770e 100644
--- a/Android.mk
+++ b/Android.mk
@@ -173,12 +173,6 @@ ifeq ($(JAVASCRIPT_ENGINE),v8)
include $(LOCAL_PATH)/Android.v8bindings.mk
# TODO: We should use the WebCore JNI code instead.
JNI_PATH := V8Binding/jni
-# bridge/jni path must be listed after V8Bindings, so files are preferentially
-# included from V8bindings.
-BINDING_C_INCLUDES += \
- $(BASE_PATH)/$(JNI_PATH) \
- $(LOCAL_PATH)/bridge/jni \
- $(LOCAL_PATH)/bridge/jni/v8
JNI_SRC_FILES := \
jni_runtime.cpp
WEBKIT_SRC_FILES += $(addprefix $(JNI_PATH)/,$(JNI_SRC_FILES))
diff --git a/V8Binding/jni/jni_runtime.cpp b/V8Binding/jni/jni_runtime.cpp
index 3b183bc..edb1b2f 100644
--- a/V8Binding/jni/jni_runtime.cpp
+++ b/V8Binding/jni/jni_runtime.cpp
@@ -24,7 +24,7 @@
*/
#include "config.h"
-#include "jni_runtime.h"
+#include "JNIBridge.h"
#include "JNIUtility.h"
#include "StringBuilder.h"
diff --git a/V8Binding/jni/jni_runtime.h b/V8Binding/jni/jni_runtime.h
deleted file mode 100644
index c6565d0..0000000
--- a/V8Binding/jni/jni_runtime.h
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
- * Copyright 2010, The Android Open Source Project
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef jni_runtime_h
-#define jni_runtime_h
-
-#include "Bridge.h"
-#include "JNIUtility.h"
-
-#if USE(V8)
-#include "JavaStringV8.h"
-#endif
-
-namespace JSC {
-
-namespace Bindings {
-
-typedef const char* RuntimeType;
-
-class JavaString {
-public:
- JavaString()
- {
- m_impl.init();
- }
-
- JavaString(JNIEnv* e, jstring s)
- {
- m_impl.init(e, s);
- }
-
- JavaString(jstring s)
- {
- m_impl.init(getJNIEnv(), s);
- }
-
- const char* UTF8String() const { return m_impl.UTF8String(); }
- const jchar* uchars() const { return m_impl.uchars(); }
- int length() const { return m_impl.length(); }
-
-private:
- JavaStringImpl m_impl;
-};
-
-class JavaParameter {
-public:
- JavaParameter() : m_JNIType(invalid_type) { }
- JavaParameter(JNIEnv*, jstring type);
- virtual ~JavaParameter() { }
-
- RuntimeType type() const { return m_type.UTF8String(); }
- JNIType getJNIType() const { return m_JNIType; }
-
-private:
- JavaString m_type;
- JNIType m_JNIType;
-};
-
-class JavaMethod : public Method {
-public:
- JavaMethod(JNIEnv*, jobject aMethod);
- ~JavaMethod();
-
- const JavaString& name() const { return m_name; }
- RuntimeType returnType() const { return m_returnType.UTF8String(); }
- JavaParameter* parameterAt(int i) const { return &m_parameters[i]; }
- int numParameters() const { return m_numParameters; }
-
- const char* signature() const;
- JNIType JNIReturnType() const;
-
- jmethodID methodID(jobject obj) const;
-
- bool isStatic() const { return m_isStatic; }
-
-private:
- JavaParameter* m_parameters;
- int m_numParameters;
- JavaString m_name;
- mutable char* m_signature;
- JavaString m_returnType;
- JNIType m_JNIReturnType;
- mutable jmethodID m_methodID;
- bool m_isStatic;
-};
-
-} // namespace Bindings
-
-} // namespace JSC
-
-#endif // jni_runtime_h
diff --git a/WebCore/Android.v8bindings.mk b/WebCore/Android.v8bindings.mk
index ce6c42d..6aa18d4 100644
--- a/WebCore/Android.v8bindings.mk
+++ b/WebCore/Android.v8bindings.mk
@@ -31,6 +31,8 @@ BINDING_C_INCLUDES := \
$(LOCAL_PATH)/bindings/v8 \
$(LOCAL_PATH)/bindings/v8/custom \
$(LOCAL_PATH)/bridge \
+ $(LOCAL_PATH)/bridge/jni \
+ $(LOCAL_PATH)/bridge/jni/v8 \
$(LOCAL_PATH)/bridge/jsc \
\
$(base_intermediates)/WebCore/bindings \
diff --git a/WebCore/bridge/jni/JNIBridge.h b/WebCore/bridge/jni/JNIBridge.h
index 712ee7d..c48ed98 100644
--- a/WebCore/bridge/jni/JNIBridge.h
+++ b/WebCore/bridge/jni/JNIBridge.h
@@ -29,10 +29,15 @@
#if ENABLE(MAC_JAVA_BRIDGE)
+#include "Bridge.h"
#include "JNIUtility.h"
+// ANDROID
+// Upstream the V8 ifdef to webkit.org
#if USE(JSC)
#include "JavaStringJSC.h"
+#elif USE(V8)
+#include "JavaStringV8.h"
#endif
namespace JSC {
diff --git a/WebCore/bridge/jni/v8/JNIBridgeV8.h b/WebCore/bridge/jni/v8/JNIBridgeV8.h
index 3922d62..eb5c77a 100644
--- a/WebCore/bridge/jni/v8/JNIBridgeV8.h
+++ b/WebCore/bridge/jni/v8/JNIBridgeV8.h
@@ -26,11 +26,9 @@
#ifndef JNIBridgeV8_h
#define JNIBridgeV8_h
+#include "JNIBridge.h"
#include "JNIUtility.h"
#include "JavaInstanceV8.h"
-#include "JavaStringV8.h"
-#include "jni_runtime.h"
-
namespace JSC {
diff --git a/WebCore/bridge/jni/v8/JNIUtilityPrivate.cpp b/WebCore/bridge/jni/v8/JNIUtilityPrivate.cpp
index a71814c..a6cfb2d 100644
--- a/WebCore/bridge/jni/v8/JNIUtilityPrivate.cpp
+++ b/WebCore/bridge/jni/v8/JNIUtilityPrivate.cpp
@@ -26,9 +26,9 @@
#include "config.h"
#include "JNIUtilityPrivate.h"
+#include "JNIBridge.h"
#include "JavaInstanceV8.h"
#include "JavaNPObjectV8.h"
-#include "jni_runtime.h"
namespace JSC {
diff --git a/WebCore/bridge/jni/v8/JavaClassV8.cpp b/WebCore/bridge/jni/v8/JavaClassV8.cpp
index c29cf86..8d794ee 100644
--- a/WebCore/bridge/jni/v8/JavaClassV8.cpp
+++ b/WebCore/bridge/jni/v8/JavaClassV8.cpp
@@ -27,8 +27,8 @@
#include "config.h"
#include "JavaClassV8.h"
+#include "JNIBridge.h"
#include "JNIUtility.h"
-#include "jni_runtime.h"
using namespace JSC::Bindings;
diff --git a/WebCore/bridge/jni/v8/JavaInstanceV8.cpp b/WebCore/bridge/jni/v8/JavaInstanceV8.cpp
index 13d4984..4d6b49f 100644
--- a/WebCore/bridge/jni/v8/JavaInstanceV8.cpp
+++ b/WebCore/bridge/jni/v8/JavaInstanceV8.cpp
@@ -26,9 +26,9 @@
#include "config.h"
#include "JavaInstanceV8.h"
+#include "JNIBridge.h"
#include "JNIUtility.h"
#include "JavaClassV8.h"
-#include "jni_runtime.h"
#include <assert.h>
#include <utils/Log.h>
diff --git a/WebCore/bridge/jni/v8/JavaNPObjectV8.cpp b/WebCore/bridge/jni/v8/JavaNPObjectV8.cpp
index 636d075..94c2198 100644
--- a/WebCore/bridge/jni/v8/JavaNPObjectV8.cpp
+++ b/WebCore/bridge/jni/v8/JavaNPObjectV8.cpp
@@ -30,7 +30,6 @@
#include "JNIUtility.h"
#include "JavaClassV8.h"
#include "JavaInstanceV8.h"
-#include "jni_runtime.h"
#include "npruntime_impl.h"
namespace JSC {
diff --git a/WebCore/bridge/jni/v8/JavaNPObjectV8.h b/WebCore/bridge/jni/v8/JavaNPObjectV8.h
index c36ef70..89e2f3b 100644
--- a/WebCore/bridge/jni/v8/JavaNPObjectV8.h
+++ b/WebCore/bridge/jni/v8/JavaNPObjectV8.h
@@ -26,7 +26,7 @@
#ifndef JavaNPObjectV8_h
#define JavaNPObjectV8_h
-#include "jni_runtime.h"
+#include "JNIBridge.h"
#include "npruntime.h"
#include <JavaVM/jni.h>
#include <wtf/RefPtr.h>