Diff
Modified: trunk/Source/WebCore/ChangeLog (92680 => 92681)
--- trunk/Source/WebCore/ChangeLog 2011-08-09 14:10:57 UTC (rev 92680)
+++ trunk/Source/WebCore/ChangeLog 2011-08-09 14:18:53 UTC (rev 92681)
@@ -1,3 +1,37 @@
+2011-08-09 Steve Block <stevebl...@google.com>
+
+ JavaMethodJobject is no longer needed by V8
+ https://bugs.webkit.org/show_bug.cgi?id=65910
+
+ Reviewed by Tony Gentilcore.
+
+ Removes the JavaMethod interface and moves the JavaMethodJobject
+ implementation to bridge/jni/jsc/JavaMethodJSC.[cpp|h].
+
+ No new tests, refactoring only.
+
+ * GNUmakefile.list.am:
+ * WebCore.gypi:
+ * WebCore.xcodeproj/project.pbxproj:
+ * bridge/jni/JavaMethod.h: Removed.
+ * bridge/jni/jsc/JavaClassJSC.cpp:
+ (JavaClass::JavaClass):
+ * bridge/jni/jsc/JavaFieldJSC.h:
+ * bridge/jni/jsc/JavaInstanceJSC.cpp:
+ * bridge/jni/jsc/JavaMethodJSC.cpp: Renamed from Source/WebCore/bridge/jni/JavaMethodJobject.cpp.
+ (JavaMethod::JavaMethod):
+ (JavaMethod::~JavaMethod):
+ (appendClassName):
+ (JavaMethod::signature):
+ * bridge/jni/jsc/JavaMethodJSC.h: Renamed from Source/WebCore/bridge/jni/JavaMethodJobject.h.
+ (JSC::Bindings::JavaMethod::name):
+ (JSC::Bindings::JavaMethod::returnTypeClassName):
+ (JSC::Bindings::JavaMethod::parameterAt):
+ (JSC::Bindings::JavaMethod::returnType):
+ (JSC::Bindings::JavaMethod::isStatic):
+ (JSC::Bindings::JavaMethod::numParameters):
+ * bridge/jni/v8/JavaNPObjectV8.cpp:
+
2011-08-09 Andrey Kosyakov <ca...@chromium.org>
Web Inspector: assertion failure in InspectorDOMStorageResource::bind when opening inspector
Modified: trunk/Source/WebCore/GNUmakefile.list.am (92680 => 92681)
--- trunk/Source/WebCore/GNUmakefile.list.am 2011-08-09 14:10:57 UTC (rev 92680)
+++ trunk/Source/WebCore/GNUmakefile.list.am 2011-08-09 14:18:53 UTC (rev 92681)
@@ -884,9 +884,6 @@
Source/WebCore/bridge/IdentifierRep.cpp \
Source/WebCore/bridge/IdentifierRep.h \
Source/WebCore/bridge/jni/JNIUtility.h \
- Source/WebCore/bridge/jni/JavaMethod.h \
- Source/WebCore/bridge/jni/JavaMethodJobject.cpp \
- Source/WebCore/bridge/jni/JavaMethodJobject.h \
Source/WebCore/bridge/jni/JavaString.h \
Source/WebCore/bridge/jni/JavaType.h \
Source/WebCore/bridge/jni/jni_jsobject.h \
@@ -894,6 +891,8 @@
Source/WebCore/bridge/jni/jsc/JavaClassJSC.h \
Source/WebCore/bridge/jni/jsc/JavaFieldJSC.h \
Source/WebCore/bridge/jni/jsc/JavaInstanceJSC.h \
+ Source/WebCore/bridge/jni/jsc/JavaMethodJSC.cpp \
+ Source/WebCore/bridge/jni/jsc/JavaMethodJSC.h \
Source/WebCore/bridge/jsc/BridgeJSC.cpp \
Source/WebCore/bridge/jsc/BridgeJSC.h \
Source/WebCore/bridge/npapi.h \
Modified: trunk/Source/WebCore/WebCore.gypi (92680 => 92681)
--- trunk/Source/WebCore/WebCore.gypi 2011-08-09 14:10:57 UTC (rev 92680)
+++ trunk/Source/WebCore/WebCore.gypi 2011-08-09 14:18:53 UTC (rev 92681)
@@ -2232,9 +2232,6 @@
'bridge/c/c_utility.cpp',
'bridge/c/c_utility.h',
'bridge/jni/JNIUtility.cpp',
- 'bridge/jni/JavaMethod.h',
- 'bridge/jni/JavaMethodJobject.cpp',
- 'bridge/jni/JavaMethodJobject.h',
'bridge/jni/JavaString.h',
'bridge/jni/JavaType.h',
'bridge/jni/JobjectWrapper.cpp',
@@ -2251,6 +2248,8 @@
'bridge/jni/jsc/JavaFieldJSC.h',
'bridge/jni/jsc/JavaInstanceJSC.cpp',
'bridge/jni/jsc/JavaInstanceJSC.h',
+ 'bridge/jni/jsc/JavaMethodJSC.cpp',
+ 'bridge/jni/jsc/JavaMethodJSC.h',
'bridge/jni/jsc/JavaRuntimeObject.cpp',
'bridge/jni/jsc/JavaRuntimeObject.h',
'bridge/jni/jsc/JavaStringJSC.h',
Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (92680 => 92681)
--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2011-08-09 14:10:57 UTC (rev 92680)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2011-08-09 14:18:53 UTC (rev 92681)
@@ -1503,7 +1503,6 @@
5913A24213D49EBA00F5B05C /* IdentifiersFactory.h in Headers */ = {isa = PBXBuildFile; fileRef = 5913A24013D49EBA00F5B05C /* IdentifiersFactory.h */; };
59309A1111F4AE5800250603 /* DeviceOrientationClientMock.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 59309A1011F4AE5800250603 /* DeviceOrientationClientMock.cpp */; };
59309A1311F4AE6A00250603 /* DeviceOrientationClientMock.h in Headers */ = {isa = PBXBuildFile; fileRef = 59309A1211F4AE6A00250603 /* DeviceOrientationClientMock.h */; settings = {ATTRIBUTES = (Private, ); }; };
- 593D3EAF1325328C0057E7EE /* JavaMethod.h in Headers */ = {isa = PBXBuildFile; fileRef = 593D3EAE1325328C0057E7EE /* JavaMethod.h */; };
593D3EB1132532950057E7EE /* JavaString.h in Headers */ = {isa = PBXBuildFile; fileRef = 593D3EB0132532950057E7EE /* JavaString.h */; };
596950821321059900C3ED18 /* JobjectWrapper.h in Headers */ = {isa = PBXBuildFile; fileRef = 596950811321059900C3ED18 /* JobjectWrapper.h */; };
59695084132105A500C3ED18 /* JobjectWrapper.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 59695083132105A500C3ED18 /* JobjectWrapper.cpp */; };
@@ -1515,8 +1514,6 @@
598D77DF132541FA00761B22 /* JavaArrayJSC.h in Headers */ = {isa = PBXBuildFile; fileRef = 598D77DE132541FA00761B22 /* JavaArrayJSC.h */; };
598D77E11325420400761B22 /* JavaFieldJSC.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 598D77E01325420400761B22 /* JavaFieldJSC.cpp */; };
598D77E31325420E00761B22 /* JavaFieldJSC.h in Headers */ = {isa = PBXBuildFile; fileRef = 598D77E21325420E00761B22 /* JavaFieldJSC.h */; };
- 599C671C1343438900C3423C /* JavaMethodJobject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 599C671B1343438900C3423C /* JavaMethodJobject.cpp */; };
- 599C671E1343439400C3423C /* JavaMethodJobject.h in Headers */ = {isa = PBXBuildFile; fileRef = 599C671D1343439400C3423C /* JavaMethodJobject.h */; };
599E759011055A1F00D904FA /* Bridge.h in Headers */ = {isa = PBXBuildFile; fileRef = 599E758F11055A1F00D904FA /* Bridge.h */; settings = {ATTRIBUTES = (Private, ); }; };
59A85EA2119D68D900DEF1EF /* DeviceOrientationEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 59A85EA1119D68D900DEF1EF /* DeviceOrientationEvent.cpp */; };
59A85EA4119D68EC00DEF1EF /* DeviceOrientationEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 59A85EA3119D68EC00DEF1EF /* DeviceOrientationEvent.h */; };
@@ -1536,6 +1533,8 @@
59C28045138DC2410079B7E2 /* XMLErrors.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 59C28043138DC2410079B7E2 /* XMLErrors.cpp */; };
59C28046138DC2410079B7E2 /* XMLErrors.h in Headers */ = {isa = PBXBuildFile; fileRef = 59C28044138DC2410079B7E2 /* XMLErrors.h */; };
59D1C10411EB5DCF00B638C8 /* DeviceOrientation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 59D1C10311EB5DCF00B638C8 /* DeviceOrientation.cpp */; };
+ 59DE790413F16C7F0007FCDF /* JavaMethodJSC.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 59DE790313F16C7F0007FCDF /* JavaMethodJSC.cpp */; };
+ 59DE790613F16C8C0007FCDF /* JavaMethodJSC.h in Headers */ = {isa = PBXBuildFile; fileRef = 59DE790513F16C8C0007FCDF /* JavaMethodJSC.h */; };
59E560A71105336600AA1258 /* JavaClassJSC.h in Headers */ = {isa = PBXBuildFile; fileRef = 59E560A61105336600AA1258 /* JavaClassJSC.h */; };
59E560A91105336F00AA1258 /* JavaClassJSC.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 59E560A81105336F00AA1258 /* JavaClassJSC.cpp */; };
59EE122C1106080500885116 /* JNIUtilityPrivate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 59EE122B1106080500885116 /* JNIUtilityPrivate.cpp */; };
@@ -8121,7 +8120,6 @@
59309A1211F4AE6A00250603 /* DeviceOrientationClientMock.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DeviceOrientationClientMock.h; path = mock/DeviceOrientationClientMock.h; sourceTree = "<group>"; };
593AB6971355CD9200FC8211 /* PositionCallback.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = PositionCallback.idl; sourceTree = "<group>"; };
593AB6991355CDAE00FC8211 /* PositionErrorCallback.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = PositionErrorCallback.idl; sourceTree = "<group>"; };
- 593D3EAE1325328C0057E7EE /* JavaMethod.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JavaMethod.h; sourceTree = "<group>"; };
593D3EB0132532950057E7EE /* JavaString.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JavaString.h; sourceTree = "<group>"; };
5958F1CB1343917C0080B31F /* XMLViewer.css */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.css; path = XMLViewer.css; sourceTree = "<group>"; };
5958F1CC1343917C0080B31F /* XMLViewer.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode._javascript_; path = XMLViewer.js; sourceTree = "<group>"; };
@@ -8135,8 +8133,6 @@
598D77DE132541FA00761B22 /* JavaArrayJSC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = JavaArrayJSC.h; path = jsc/JavaArrayJSC.h; sourceTree = "<group>"; };
598D77E01325420400761B22 /* JavaFieldJSC.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = JavaFieldJSC.cpp; path = jsc/JavaFieldJSC.cpp; sourceTree = "<group>"; };
598D77E21325420E00761B22 /* JavaFieldJSC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = JavaFieldJSC.h; path = jsc/JavaFieldJSC.h; sourceTree = "<group>"; };
- 599C671B1343438900C3423C /* JavaMethodJobject.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JavaMethodJobject.cpp; sourceTree = "<group>"; };
- 599C671D1343439400C3423C /* JavaMethodJobject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JavaMethodJobject.h; sourceTree = "<group>"; };
599E758F11055A1F00D904FA /* Bridge.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Bridge.h; path = bridge/Bridge.h; sourceTree = "<group>"; };
59A85EA1119D68D900DEF1EF /* DeviceOrientationEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DeviceOrientationEvent.cpp; sourceTree = "<group>"; };
59A85EA3119D68EC00DEF1EF /* DeviceOrientationEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DeviceOrientationEvent.h; sourceTree = "<group>"; };
@@ -8157,6 +8153,8 @@
59C28043138DC2410079B7E2 /* XMLErrors.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = XMLErrors.cpp; sourceTree = "<group>"; };
59C28044138DC2410079B7E2 /* XMLErrors.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XMLErrors.h; sourceTree = "<group>"; };
59D1C10311EB5DCF00B638C8 /* DeviceOrientation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DeviceOrientation.cpp; sourceTree = "<group>"; };
+ 59DE790313F16C7F0007FCDF /* JavaMethodJSC.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = JavaMethodJSC.cpp; path = jsc/JavaMethodJSC.cpp; sourceTree = "<group>"; };
+ 59DE790513F16C8C0007FCDF /* JavaMethodJSC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = JavaMethodJSC.h; path = jsc/JavaMethodJSC.h; sourceTree = "<group>"; };
59E560A61105336600AA1258 /* JavaClassJSC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = JavaClassJSC.h; path = jsc/JavaClassJSC.h; sourceTree = "<group>"; };
59E560A81105336F00AA1258 /* JavaClassJSC.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = JavaClassJSC.cpp; path = jsc/JavaClassJSC.cpp; sourceTree = "<group>"; };
59EE122B1106080500885116 /* JNIUtilityPrivate.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = JNIUtilityPrivate.cpp; path = jsc/JNIUtilityPrivate.cpp; sourceTree = "<group>"; };
@@ -13249,9 +13247,6 @@
1A569CCE0D7E2B82007C3983 /* jni */ = {
isa = PBXGroup;
children = (
- 593D3EAE1325328C0057E7EE /* JavaMethod.h */,
- 599C671B1343438900C3423C /* JavaMethodJobject.cpp */,
- 599C671D1343439400C3423C /* JavaMethodJobject.h */,
593D3EB0132532950057E7EE /* JavaString.h */,
59B0EEA6132A6F2A004331C7 /* JavaType.h */,
1A569CD40D7E2B82007C3983 /* jni_jsobject.h */,
@@ -14233,6 +14228,8 @@
599D1E2F10C97D4C00E0EF12 /* jsc */ = {
isa = PBXGroup;
children = (
+ 59DE790513F16C8C0007FCDF /* JavaMethodJSC.h */,
+ 59DE790313F16C7F0007FCDF /* JavaMethodJSC.cpp */,
598D77DC132541EE00761B22 /* JavaArrayJSC.cpp */,
598D77DE132541FA00761B22 /* JavaArrayJSC.h */,
59E560A81105336F00AA1258 /* JavaClassJSC.cpp */,
@@ -21755,8 +21752,6 @@
59E560A71105336600AA1258 /* JavaClassJSC.h in Headers */,
598D77E31325420E00761B22 /* JavaFieldJSC.h in Headers */,
59A9E7B21104759400DFB4C1 /* JavaInstanceJSC.h in Headers */,
- 593D3EAF1325328C0057E7EE /* JavaMethod.h in Headers */,
- 599C671E1343439400C3423C /* JavaMethodJobject.h in Headers */,
E16982681134680700894115 /* JavaRuntimeObject.h in Headers */,
FD31603612B0267600C1A359 /* _javascript_AudioNode.h in Headers */,
1C81BA0A0E97348300266E07 /* _javascript_CallFrame.h in Headers */,
@@ -23357,6 +23352,7 @@
E1BE512E0CF6C512002EA959 /* XSLTUnicodeSort.h in Headers */,
977E2E0F12F0FC9C00C13379 /* XSSAuditor.h in Headers */,
FD537353137B651800008DCE /* ZeroPole.h in Headers */,
+ 59DE790613F16C8C0007FCDF /* JavaMethodJSC.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -24671,7 +24667,6 @@
59E560A91105336F00AA1258 /* JavaClassJSC.cpp in Sources */,
598D77E11325420400761B22 /* JavaFieldJSC.cpp in Sources */,
59A9E7B01104758800DFB4C1 /* JavaInstanceJSC.cpp in Sources */,
- 599C671C1343438900C3423C /* JavaMethodJobject.cpp in Sources */,
E1698264113467F300894115 /* JavaRuntimeObject.cpp in Sources */,
FD31603512B0267600C1A359 /* _javascript_AudioNode.cpp in Sources */,
1C81BA090E97348300266E07 /* _javascript_CallFrame.cpp in Sources */,
@@ -26165,6 +26160,7 @@
E1BE512D0CF6C512002EA959 /* XSLTUnicodeSort.cpp in Sources */,
977E2E0E12F0FC9C00C13379 /* XSSAuditor.cpp in Sources */,
FD537352137B651800008DCE /* ZeroPole.cpp in Sources */,
+ 59DE790413F16C7F0007FCDF /* JavaMethodJSC.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Deleted: trunk/Source/WebCore/bridge/jni/JavaMethod.h (92680 => 92681)
--- trunk/Source/WebCore/bridge/jni/JavaMethod.h 2011-08-09 14:10:57 UTC (rev 92680)
+++ trunk/Source/WebCore/bridge/jni/JavaMethod.h 2011-08-09 14:18:53 UTC (rev 92681)
@@ -1,61 +0,0 @@
-/*
- * Copyright (C) 2003, 2004, 2005, 2007, 2009, 2010 Apple Inc. All rights reserved.
- * 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 JavaMethod_h
-#define JavaMethod_h
-
-#if ENABLE(JAVA_BRIDGE)
-
-#include "Bridge.h"
-#include "JavaType.h"
-
-#include <wtf/text/WTFString.h>
-
-namespace JSC {
-
-namespace Bindings {
-
-typedef const char* RuntimeType;
-
-class JavaMethod : public Method {
-public:
- virtual ~JavaMethod() {}
-
- virtual String name() const = 0;
- virtual RuntimeType returnTypeClassName() const = 0;
- virtual String parameterAt(int) const = 0;
- virtual const char* signature() const = 0;
- virtual JavaType returnType() const = 0;
- virtual bool isStatic() const = 0;
-};
-
-} // namespace Bindings
-
-} // namespace JSC
-
-#endif // ENABLE(JAVA_BRIDGE)
-
-#endif // JavaMethod_h
Deleted: trunk/Source/WebCore/bridge/jni/JavaMethodJobject.cpp (92680 => 92681)
--- trunk/Source/WebCore/bridge/jni/JavaMethodJobject.cpp 2011-08-09 14:10:57 UTC (rev 92680)
+++ trunk/Source/WebCore/bridge/jni/JavaMethodJobject.cpp 2011-08-09 14:18:53 UTC (rev 92681)
@@ -1,167 +0,0 @@
-/*
- * Copyright (C) 2003, 2004, 2005, 2007, 2009 Apple Inc. All rights reserved.
- * 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.
- */
-
-#include "config.h"
-#include "JavaMethodJobject.h"
-
-#if ENABLE(JAVA_BRIDGE)
-
-#include "JavaString.h"
-
-#if USE(JSC)
-#include <runtime/JSObject.h>
-#include <runtime/ScopeChain.h>
-#endif
-#include <wtf/text/StringBuilder.h>
-
-using namespace JSC;
-using namespace JSC::Bindings;
-
-JavaMethodJobject::JavaMethodJobject(JNIEnv* env, jobject aMethod)
-{
- // Get return type name
- jstring returnTypeName = 0;
- if (jobject returnType = callJNIMethod<jobject>(aMethod, "getReturnType", "()Ljava/lang/Class;")) {
- returnTypeName = static_cast<jstring>(callJNIMethod<jobject>(returnType, "getName", "()Ljava/lang/String;"));
- if (!returnTypeName)
- returnTypeName = env->NewStringUTF("<Unknown>");
- env->DeleteLocalRef(returnType);
- }
- m_returnTypeClassName = JavaString(env, returnTypeName);
- m_returnType = javaTypeFromClassName(m_returnTypeClassName.utf8());
- env->DeleteLocalRef(returnTypeName);
-
- // Get method name
- jstring methodName = static_cast<jstring>(callJNIMethod<jobject>(aMethod, "getName", "()Ljava/lang/String;"));
- if (!methodName)
- methodName = env->NewStringUTF("<Unknown>");
- m_name = JavaString(env, methodName);
- env->DeleteLocalRef(methodName);
-
- // Get parameters
- if (jarray jparameters = static_cast<jarray>(callJNIMethod<jobject>(aMethod, "getParameterTypes", "()[Ljava/lang/Class;"))) {
- unsigned int numParams = env->GetArrayLength(jparameters);
-
- for (unsigned int i = 0; i < numParams; i++) {
- jobject aParameter = env->GetObjectArrayElement(static_cast<jobjectArray>(jparameters), i);
- jstring parameterName = static_cast<jstring>(callJNIMethod<jobject>(aParameter, "getName", "()Ljava/lang/String;"));
- if (!parameterName)
- parameterName = env->NewStringUTF("<Unknown>");
- m_parameters.append(JavaString(env, parameterName).impl());
- env->DeleteLocalRef(aParameter);
- env->DeleteLocalRef(parameterName);
- }
- env->DeleteLocalRef(jparameters);
- }
-
- // Created lazily.
- m_signature = 0;
-
- jclass modifierClass = env->FindClass("java/lang/reflect/Modifier");
- int modifiers = callJNIMethod<jint>(aMethod, "getModifiers", "()I");
- m_isStatic = static_cast<bool>(callJNIStaticMethod<jboolean>(modifierClass, "isStatic", "(I)Z", modifiers));
- env->DeleteLocalRef(modifierClass);
-}
-
-JavaMethodJobject::~JavaMethodJobject()
-{
- if (m_signature)
- fastFree(m_signature);
-}
-
-// JNI method signatures use '/' between components of a class name, but
-// we get '.' between components from the reflection API.
-static void appendClassName(StringBuilder& builder, const char* className)
-{
-#if USE(JSC)
- ASSERT(JSLock::lockCount() > 0);
-#endif
-
- char* c = fastStrDup(className);
-
- char* result = c;
- while (*c) {
- if (*c == '.')
- *c = '/';
- c++;
- }
-
- builder.append(result);
-
- fastFree(result);
-}
-
-const char* JavaMethodJobject::signature() const
-{
- if (!m_signature) {
-#if USE(JSC)
- JSLock lock(SilenceAssertionsOnly);
-#endif
-
- StringBuilder signatureBuilder;
- signatureBuilder.append('(');
- for (unsigned int i = 0; i < m_parameters.size(); i++) {
- CString javaClassName = parameterAt(i).utf8();
- JavaType type = javaTypeFromClassName(javaClassName.data());
- if (type == JavaTypeArray)
- appendClassName(signatureBuilder, javaClassName.data());
- else {
- signatureBuilder.append(signatureFromJavaType(type));
- if (type == JavaTypeObject
-#if USE(V8)
- || type == JavaTypeString
-#endif
- ) {
- appendClassName(signatureBuilder, javaClassName.data());
- signatureBuilder.append(';');
- }
- }
- }
- signatureBuilder.append(')');
-
- const char* returnType = m_returnTypeClassName.utf8();
- if (m_returnType == JavaTypeArray)
- appendClassName(signatureBuilder, returnType);
- else {
- signatureBuilder.append(signatureFromJavaType(m_returnType));
- if (m_returnType == JavaTypeObject
-#if USE(V8)
- || m_returnType == JavaTypeString
-#endif
- ) {
- appendClassName(signatureBuilder, returnType);
- signatureBuilder.append(';');
- }
- }
-
- String signatureString = signatureBuilder.toString();
- m_signature = fastStrDup(signatureString.utf8().data());
- }
-
- return m_signature;
-}
-
-#endif // ENABLE(JAVA_BRIDGE)
Deleted: trunk/Source/WebCore/bridge/jni/JavaMethodJobject.h (92680 => 92681)
--- trunk/Source/WebCore/bridge/jni/JavaMethodJobject.h 2011-08-09 14:10:57 UTC (rev 92680)
+++ trunk/Source/WebCore/bridge/jni/JavaMethodJobject.h 2011-08-09 14:18:53 UTC (rev 92681)
@@ -1,72 +0,0 @@
-/*
- * Copyright (C) 2003, 2004, 2005, 2007, 2009, 2010 Apple Inc. All rights reserved.
- * 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 JavaMethodJobject_h
-#define JavaMethodJobject_h
-
-#if ENABLE(JAVA_BRIDGE)
-
-#include "JavaMethod.h"
-#include "JavaString.h"
-
-#include <wtf/text/CString.h>
-
-namespace JSC {
-
-namespace Bindings {
-
-class JavaMethodJobject : public JavaMethod {
-public:
- JavaMethodJobject(JNIEnv*, jobject);
- virtual ~JavaMethodJobject();
-
- // JavaMethod implementation
- virtual String name() const { return m_name.impl(); }
- virtual RuntimeType returnTypeClassName() const { return m_returnTypeClassName.utf8(); }
- virtual String parameterAt(int i) const { return m_parameters[i]; }
- virtual const char* signature() const;
- virtual JavaType returnType() const { return m_returnType; }
- virtual bool isStatic() const { return m_isStatic; }
-
- // Method implementation
- virtual int numParameters() const { return m_parameters.size(); }
-
-private:
- Vector<String> m_parameters;
- JavaString m_name;
- mutable char* m_signature;
- JavaString m_returnTypeClassName;
- JavaType m_returnType;
- bool m_isStatic;
-};
-
-} // namespace Bindings
-
-} // namespace JSC
-
-#endif // ENABLE(JAVA_BRIDGE)
-
-#endif // JavaMethodJobject_h
Modified: trunk/Source/WebCore/bridge/jni/jsc/JavaClassJSC.cpp (92680 => 92681)
--- trunk/Source/WebCore/bridge/jni/jsc/JavaClassJSC.cpp 2011-08-09 14:10:57 UTC (rev 92680)
+++ trunk/Source/WebCore/bridge/jni/jsc/JavaClassJSC.cpp 2011-08-09 14:18:53 UTC (rev 92681)
@@ -30,7 +30,7 @@
#include "JSDOMWindow.h"
#include "JavaFieldJSC.h"
-#include "JavaMethodJobject.h"
+#include "JavaMethodJSC.h"
#include <runtime/Identifier.h>
#include <runtime/JSLock.h>
@@ -76,7 +76,7 @@
int numMethods = env->GetArrayLength(methods);
for (i = 0; i < numMethods; i++) {
jobject aJMethod = env->GetObjectArrayElement((jobjectArray)methods, i);
- JavaMethod* aMethod = new JavaMethodJobject(env, aJMethod); // deleted in the JavaClass destructor
+ JavaMethod* aMethod = new JavaMethod(env, aJMethod); // deleted in the JavaClass destructor
MethodList* methodList;
{
JSLock lock(SilenceAssertionsOnly);
Modified: trunk/Source/WebCore/bridge/jni/jsc/JavaFieldJSC.h (92680 => 92681)
--- trunk/Source/WebCore/bridge/jni/jsc/JavaFieldJSC.h 2011-08-09 14:10:57 UTC (rev 92680)
+++ trunk/Source/WebCore/bridge/jni/jsc/JavaFieldJSC.h 2011-08-09 14:18:53 UTC (rev 92681)
@@ -31,7 +31,7 @@
#include "BridgeJSC.h"
#include "JNIUtility.h"
-#include "JavaMethod.h"
+#include "JavaMethodJSC.h"
#include "JavaString.h"
#include "JobjectWrapper.h"
Modified: trunk/Source/WebCore/bridge/jni/jsc/JavaInstanceJSC.cpp (92680 => 92681)
--- trunk/Source/WebCore/bridge/jni/jsc/JavaInstanceJSC.cpp 2011-08-09 14:10:57 UTC (rev 92680)
+++ trunk/Source/WebCore/bridge/jni/jsc/JavaInstanceJSC.cpp 2011-08-09 14:18:53 UTC (rev 92681)
@@ -33,7 +33,7 @@
#include "JSDOMBinding.h"
#include "JavaArrayJSC.h"
#include "JavaClassJSC.h"
-#include "JavaMethod.h"
+#include "JavaMethodJSC.h"
#include "JavaString.h"
#include "Logging.h"
#include "jni_jsobject.h"
Copied: trunk/Source/WebCore/bridge/jni/jsc/JavaMethodJSC.cpp (from rev 92680, trunk/Source/WebCore/bridge/jni/JavaMethodJobject.cpp) (0 => 92681)
--- trunk/Source/WebCore/bridge/jni/jsc/JavaMethodJSC.cpp (rev 0)
+++ trunk/Source/WebCore/bridge/jni/jsc/JavaMethodJSC.cpp 2011-08-09 14:18:53 UTC (rev 92681)
@@ -0,0 +1,163 @@
+/*
+ * Copyright (C) 2003, 2004, 2005, 2007, 2009 Apple Inc. All rights reserved.
+ * 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.
+ */
+
+#include "config.h"
+#include "JavaMethodJSC.h"
+
+#if ENABLE(JAVA_BRIDGE)
+
+#include <runtime/JSObject.h>
+#include <runtime/ScopeChain.h>
+#include <wtf/text/StringBuilder.h>
+
+using namespace JSC;
+using namespace JSC::Bindings;
+
+JavaMethod::JavaMethod(JNIEnv* env, jobject aMethod)
+{
+ // Get return type name
+ jstring returnTypeName = 0;
+ if (jobject returnType = callJNIMethod<jobject>(aMethod, "getReturnType", "()Ljava/lang/Class;")) {
+ returnTypeName = static_cast<jstring>(callJNIMethod<jobject>(returnType, "getName", "()Ljava/lang/String;"));
+ if (!returnTypeName)
+ returnTypeName = env->NewStringUTF("<Unknown>");
+ env->DeleteLocalRef(returnType);
+ }
+ m_returnTypeClassName = JavaString(env, returnTypeName);
+ m_returnType = javaTypeFromClassName(m_returnTypeClassName.utf8());
+ env->DeleteLocalRef(returnTypeName);
+
+ // Get method name
+ jstring methodName = static_cast<jstring>(callJNIMethod<jobject>(aMethod, "getName", "()Ljava/lang/String;"));
+ if (!methodName)
+ methodName = env->NewStringUTF("<Unknown>");
+ m_name = JavaString(env, methodName);
+ env->DeleteLocalRef(methodName);
+
+ // Get parameters
+ if (jarray jparameters = static_cast<jarray>(callJNIMethod<jobject>(aMethod, "getParameterTypes", "()[Ljava/lang/Class;"))) {
+ unsigned int numParams = env->GetArrayLength(jparameters);
+
+ for (unsigned int i = 0; i < numParams; i++) {
+ jobject aParameter = env->GetObjectArrayElement(static_cast<jobjectArray>(jparameters), i);
+ jstring parameterName = static_cast<jstring>(callJNIMethod<jobject>(aParameter, "getName", "()Ljava/lang/String;"));
+ if (!parameterName)
+ parameterName = env->NewStringUTF("<Unknown>");
+ m_parameters.append(JavaString(env, parameterName).impl());
+ env->DeleteLocalRef(aParameter);
+ env->DeleteLocalRef(parameterName);
+ }
+ env->DeleteLocalRef(jparameters);
+ }
+
+ // Created lazily.
+ m_signature = 0;
+
+ jclass modifierClass = env->FindClass("java/lang/reflect/Modifier");
+ int modifiers = callJNIMethod<jint>(aMethod, "getModifiers", "()I");
+ m_isStatic = static_cast<bool>(callJNIStaticMethod<jboolean>(modifierClass, "isStatic", "(I)Z", modifiers));
+ env->DeleteLocalRef(modifierClass);
+}
+
+JavaMethod::~JavaMethod()
+{
+ if (m_signature)
+ fastFree(m_signature);
+}
+
+// JNI method signatures use '/' between components of a class name, but
+// we get '.' between components from the reflection API.
+static void appendClassName(StringBuilder& builder, const char* className)
+{
+#if USE(JSC)
+ ASSERT(JSLock::lockCount() > 0);
+#endif
+
+ char* c = fastStrDup(className);
+
+ char* result = c;
+ while (*c) {
+ if (*c == '.')
+ *c = '/';
+ c++;
+ }
+
+ builder.append(result);
+
+ fastFree(result);
+}
+
+const char* JavaMethod::signature() const
+{
+ if (!m_signature) {
+#if USE(JSC)
+ JSLock lock(SilenceAssertionsOnly);
+#endif
+
+ StringBuilder signatureBuilder;
+ signatureBuilder.append('(');
+ for (unsigned int i = 0; i < m_parameters.size(); i++) {
+ CString javaClassName = parameterAt(i).utf8();
+ JavaType type = javaTypeFromClassName(javaClassName.data());
+ if (type == JavaTypeArray)
+ appendClassName(signatureBuilder, javaClassName.data());
+ else {
+ signatureBuilder.append(signatureFromJavaType(type));
+ if (type == JavaTypeObject
+#if USE(V8)
+ || type == JavaTypeString
+#endif
+ ) {
+ appendClassName(signatureBuilder, javaClassName.data());
+ signatureBuilder.append(';');
+ }
+ }
+ }
+ signatureBuilder.append(')');
+
+ const char* returnType = m_returnTypeClassName.utf8();
+ if (m_returnType == JavaTypeArray)
+ appendClassName(signatureBuilder, returnType);
+ else {
+ signatureBuilder.append(signatureFromJavaType(m_returnType));
+ if (m_returnType == JavaTypeObject
+#if USE(V8)
+ || m_returnType == JavaTypeString
+#endif
+ ) {
+ appendClassName(signatureBuilder, returnType);
+ signatureBuilder.append(';');
+ }
+ }
+
+ String signatureString = signatureBuilder.toString();
+ m_signature = fastStrDup(signatureString.utf8().data());
+ }
+
+ return m_signature;
+}
+
+#endif // ENABLE(JAVA_BRIDGE)
Property changes: trunk/Source/WebCore/bridge/jni/jsc/JavaMethodJSC.cpp
Added: svn:eol-style
Copied: trunk/Source/WebCore/bridge/jni/jsc/JavaMethodJSC.h (from rev 92680, trunk/Source/WebCore/bridge/jni/JavaMethodJobject.h) (0 => 92681)
--- trunk/Source/WebCore/bridge/jni/jsc/JavaMethodJSC.h (rev 0)
+++ trunk/Source/WebCore/bridge/jni/jsc/JavaMethodJSC.h 2011-08-09 14:18:53 UTC (rev 92681)
@@ -0,0 +1,72 @@
+/*
+ * Copyright (C) 2003, 2004, 2005, 2007, 2009, 2010 Apple Inc. All rights reserved.
+ * 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 JavaMethodJSC_h
+#define JavaMethodJSC_h
+
+#if ENABLE(JAVA_BRIDGE)
+
+#include "Bridge.h"
+#include "JavaString.h"
+#include "JavaType.h"
+
+namespace JSC {
+
+namespace Bindings {
+
+typedef const char* RuntimeType;
+
+class JavaMethod : public Method {
+public:
+ JavaMethod(JNIEnv*, jobject aMethod);
+ ~JavaMethod();
+
+ const String name() const { return m_name.impl(); }
+ RuntimeType returnTypeClassName() const { return m_returnTypeClassName.utf8(); }
+ const String parameterAt(int i) const { return m_parameters[i]; }
+ const char* signature() const;
+ JavaType returnType() const { return m_returnType; }
+ bool isStatic() const { return m_isStatic; }
+
+ // Method implementation
+ int numParameters() const { return m_parameters.size(); }
+
+private:
+ Vector<WTF::String> m_parameters;
+ JavaString m_name;
+ mutable char* m_signature;
+ JavaString m_returnTypeClassName;
+ JavaType m_returnType;
+ bool m_isStatic;
+};
+
+} // namespace Bindings
+
+} // namespace JSC
+
+#endif // ENABLE(JAVA_BRIDGE)
+
+#endif // JavaMethodJSC_h
Property changes: trunk/Source/WebCore/bridge/jni/jsc/JavaMethodJSC.h
Added: svn:eol-style
Modified: trunk/Source/WebCore/bridge/jni/v8/JavaNPObjectV8.cpp (92680 => 92681)
--- trunk/Source/WebCore/bridge/jni/v8/JavaNPObjectV8.cpp 2011-08-09 14:10:57 UTC (rev 92680)
+++ trunk/Source/WebCore/bridge/jni/v8/JavaNPObjectV8.cpp 2011-08-09 14:18:53 UTC (rev 92681)
@@ -33,7 +33,7 @@
#include "JavaClassV8.h"
#include "JavaFieldV8.h"
#include "JavaInstanceV8.h"
-#include "JavaMethod.h"
+#include "JavaMethodV8.h"
#include "JavaValueV8.h"
#include "npruntime_impl.h"