[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.21-584-g1e41756

ap at apple.com ap at apple.com
Fri Feb 26 22:26:30 UTC 2010


The following commit has been merged in the webkit-1.1 branch:
commit c8bc33372cd066a8c82d61dcfb24df90a7c69297
Author: ap at apple.com <ap at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Sat Feb 20 18:22:48 2010 +0000

            Reviewed by Maciej Stachowiak.
    
            https://bugs.webkit.org/show_bug.cgi?id=23742
            Applet methods can not return arrays to JS
    
            * bridge/jni/jsc/JNIBridgeJSC.cpp: (JavaArray::JavaArray): Don't accidentally zero out
            m_rootObject (that's how PassRefPtr works). Without m_rootObject, we crash quickly.
    
            * bridge/jni/jsc/JavaInstanceJSC.cpp: (JavaInstance::invokeMethod): Do handle returned arrays.
            Also, added an ifdef around  code that's only needed on Tiger, and removed a comment saying
            it can be removed when "new" plugin ships. I doubt that anyone can remember what "new"
            could refer to back then.
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@55054 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 6c836a8..03426be 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,18 @@
+2010-02-20  Alexey Proskuryakov  <ap at apple.com>
+
+        Reviewed by Maciej Stachowiak.
+
+        https://bugs.webkit.org/show_bug.cgi?id=23742
+        Applet methods can not return arrays to JS
+
+        * bridge/jni/jsc/JNIBridgeJSC.cpp: (JavaArray::JavaArray): Don't accidentally zero out
+        m_rootObject (that's how PassRefPtr works). Without m_rootObject, we crash quickly.
+
+        * bridge/jni/jsc/JavaInstanceJSC.cpp: (JavaInstance::invokeMethod): Do handle returned arrays.
+        Also, added an ifdef around  code that's only needed on Tiger, and removed a comment saying
+        it can be removed when "new" plugin ships. I doubt that anyone can remember what "new"
+        could refer to back then.
+
 2010-02-20  Pavel Feldman  <pfeldman at chromium.org>
 
         Reviewed by Timothy Hatcher.
diff --git a/WebCore/bridge/jni/jsc/JNIBridgeJSC.cpp b/WebCore/bridge/jni/jsc/JNIBridgeJSC.cpp
index 93bc01e..b598263 100644
--- a/WebCore/bridge/jni/jsc/JNIBridgeJSC.cpp
+++ b/WebCore/bridge/jni/jsc/JNIBridgeJSC.cpp
@@ -253,7 +253,6 @@ JavaArray::JavaArray(jobject array, const char* type, PassRefPtr<RootObject> roo
     JNIEnv* env = getJNIEnv();
     m_length = env->GetArrayLength(static_cast<jarray>(m_array->m_instance));
     m_type = strdup(type);
-    m_rootObject = rootObject;
 }
 
 JavaArray::~JavaArray()
diff --git a/WebCore/bridge/jni/jsc/JavaInstanceJSC.cpp b/WebCore/bridge/jni/jsc/JavaInstanceJSC.cpp
index b24d0f8..4fc7e8e 100644
--- a/WebCore/bridge/jni/jsc/JavaInstanceJSC.cpp
+++ b/WebCore/bridge/jni/jsc/JavaInstanceJSC.cpp
@@ -160,8 +160,7 @@ JSValue JavaInstance::invokeMethod(ExecState* exec, const MethodList& methodList
         }
     }
 
-    // The following code can be conditionally removed once we have a Tiger update that
-    // contains the new Java plugin.  It is needed for builds prior to Tiger.
+#ifdef BUILDING_ON_TIGER
     if (!handled) {
         jobject obj = m_instance->m_instance;
         switch (jMethod->JNIReturnType()) {
@@ -186,7 +185,6 @@ JSValue JavaInstance::invokeMethod(ExecState* exec, const MethodList& methodList
         case int_type:
             result.i = callJNIMethodIDA<jint>(obj, jMethod->methodID(obj), jArgs.data());
             break;
-
         case long_type:
             result.j = callJNIMethodIDA<jlong>(obj, jMethod->methodID(obj), jArgs.data());
             break;
@@ -196,11 +194,12 @@ JSValue JavaInstance::invokeMethod(ExecState* exec, const MethodList& methodList
         case double_type:
             result.d = callJNIMethodIDA<jdouble>(obj, jMethod->methodID(obj), jArgs.data());
             break;
+        case array_type:
         case invalid_type:
-        default:
             break;
         }
     }
+#endif
 
     switch (jMethod->JNIReturnType()) {
     case void_type:
@@ -212,6 +211,7 @@ JSValue JavaInstance::invokeMethod(ExecState* exec, const MethodList& methodList
     case object_type:
         {
             if (result.l) {
+                // FIXME: array_type return type is handled below, can we actually get an array here?
                 const char* arrayType = jMethod->returnType();
                 if (arrayType[0] == '[')
                     resultValue = JavaArray::convertJObjectToArray(exec, result.l, arrayType, rootObject);
@@ -270,8 +270,15 @@ JSValue JavaInstance::invokeMethod(ExecState* exec, const MethodList& methodList
         }
         break;
 
+    case array_type:
+        {
+            const char* arrayType = jMethod->returnType();
+            ASSERT(arrayType[0] == '[');
+            resultValue = JavaArray::convertJObjectToArray(exec, result.l, arrayType, rootObject);
+        }
+        break;
+
     case invalid_type:
-    default:
         {
             resultValue = jsUndefined();
         }

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list