Skip to content

Commit

Permalink
JavaScriptCore:
Browse files Browse the repository at this point in the history
        Reviewed by Darin, landed by Anders.

        Fix for: http://bugs.webkit.org/show_bug.cgi?id=13142

        The previous fix http://bugs.webkit.org/show_bug.cgi?id=12636 
        introduced new JNIType to enum in jni_utility.h This is a 
        problem on the Mac as it seems that the JNIType enum is also
        used in the JVM, it is used to specify the return type in
        jni_objc.mm
        Corrected the fix by moving type to the end, and changing
        jni_objc.mm to convert the new type to an old compatible
        type.

        * bindings/jni/jni_objc.mm:
        (KJS::Bindings::dispatchJNICall):
        * bindings/jni/jni_utility.h:

WebCore:

        Reviewed by Darin, landed by Anders.

        Manual test case for http://bugs.webkit.org/show_bug.cgi?id=13142

        * manual-tests/liveconnect-applet-get-boolean.html: Added.
        * manual-tests/resources/CheckerApplet.class: Added.
        * manual-tests/resources/CheckerApplet.java: Added.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@20502 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
andersca committed Mar 27, 2007
1 parent 7f11a58 commit 8a51861
Show file tree
Hide file tree
Showing 7 changed files with 68 additions and 2 deletions.
19 changes: 19 additions & 0 deletions JavaScriptCore/ChangeLog
@@ -1,3 +1,22 @@
2007-03-26 David Carson <dacarson@gmail.com>

Reviewed by Darin, landed by Anders.

Fix for: http://bugs.webkit.org/show_bug.cgi?id=13142

The previous fix http://bugs.webkit.org/show_bug.cgi?id=12636
introduced new JNIType to enum in jni_utility.h This is a
problem on the Mac as it seems that the JNIType enum is also
used in the JVM, it is used to specify the return type in
jni_objc.mm
Corrected the fix by moving type to the end, and changing
jni_objc.mm to convert the new type to an old compatible
type.

* bindings/jni/jni_objc.mm:
(KJS::Bindings::dispatchJNICall):
* bindings/jni/jni_utility.h:

2007-03-26 Christopher Brichford <chrisb@adobe.com>

Reviewed/landed by Adam.
Expand Down
4 changes: 4 additions & 0 deletions JavaScriptCore/bindings/jni/jni_objc.mm
Expand Up @@ -44,6 +44,10 @@ - (jvalue)webPlugInCallJava:(jobject)object
{
id view = (id)targetAppletView;

// As array_type is not known by the Mac JVM, change it to a compatible type.
if (returnType == array_type)
returnType = object_type;

if ([view respondsToSelector:@selector(webPlugInCallJava:isStatic:returnType:method:arguments:callingURL:exceptionDescription:)]) {
NSString *_exceptionDescription = 0;

Expand Down
9 changes: 7 additions & 2 deletions JavaScriptCore/bindings/jni/jni_utility.h
Expand Up @@ -29,19 +29,24 @@

#include <JavaVM/jni.h>

// 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
// should be added to the end. It is used in jni_obc.mm when calling
// through to the JVM. Newly added items need to be made compatible
// in that file.
typedef enum {
invalid_type = 0,
void_type,
object_type,
array_type,
boolean_type,
byte_type,
char_type,
short_type,
int_type,
long_type,
float_type,
double_type
double_type,
array_type
} JNIType;

namespace KJS {
Expand Down
10 changes: 10 additions & 0 deletions WebCore/ChangeLog
@@ -1,3 +1,13 @@
2007-03-26 David Carson <dacarson@gmail.com>

Reviewed by Darin, landed by Anders.

Manual test case for http://bugs.webkit.org/show_bug.cgi?id=13142

* manual-tests/liveconnect-applet-get-boolean.html: Added.
* manual-tests/resources/CheckerApplet.class: Added.
* manual-tests/resources/CheckerApplet.java: Added.

2007-03-26 Mitz Pettel <mitz@webkit.org>

Reviewed and landed by Darin.
Expand Down
7 changes: 7 additions & 0 deletions WebCore/manual-tests/liveconnect-applet-get-boolean.html
@@ -0,0 +1,7 @@
<html>
<body><applet code="CheckerApplet.class" name="Checker" codebase="resources">
Unable to load applet.</applet>
This tests retrieving a boolean value from a Java class using javascript. It tests the return value. The return value should be true.<br>
<input type="button" name="test" value="Read applet" onClick="alert('return value: '+document.Checker.checkVersion())"/>
</body>
<html>
Binary file added WebCore/manual-tests/resources/CheckerApplet.class
Binary file not shown.
21 changes: 21 additions & 0 deletions WebCore/manual-tests/resources/CheckerApplet.java
@@ -0,0 +1,21 @@
import java.applet.Applet;
import java.awt.Color;
import java.awt.Component;

public class CheckerApplet extends Applet
{

public boolean checkVersion()
{
return true;
}

public void start()
{
setBackground(new Color(255, 255, 255));
}

public CheckerApplet()
{
}
}

0 comments on commit 8a51861

Please sign in to comment.