From 88d4517612dafdcaff7a98f2a68ff071e2734ea6 Mon Sep 17 00:00:00 2001 From: Steve Block Date: Fri, 18 Dec 2009 12:28:23 +0000 Subject: Updates the use of weak references in the script-to-Java bridge for V8. Currently, V8 uses weak references to the Java object owned by JObjectWrapper. This is in contrast to JSC, which uses strong references in JObjectWrapper. However, for the special-case where JObjectWrapper is used in JavaInstance in WebCoreFrameBridge, JSC uses WeakJavaInstance to swap the strong references for weak references. This change updates the V8 version of JObjectWrapper to use strong references to match the JSC version. To maintain the weak reference behavior where JObjectWrapper is used in JavaInstance in WebCoreFrameBridge, V8 now make use of WeakJavaInstance too. This requires changes to jni_npobject to call the necessary methods on JavaInstance to swap the references when the object is accessed. Change-Id: I3724d7e6437588feb0268a2670b02a93b52e54f0 --- WebCore/bridge/jni/v8/jni_utility_private.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'WebCore') diff --git a/WebCore/bridge/jni/v8/jni_utility_private.cpp b/WebCore/bridge/jni/v8/jni_utility_private.cpp index c58472e..6c8f018 100644 --- a/WebCore/bridge/jni/v8/jni_utility_private.cpp +++ b/WebCore/bridge/jni/v8/jni_utility_private.cpp @@ -48,7 +48,7 @@ jvalue convertNPVariantToJValue(NPVariant value, JNIType jniType, const char* ja if (type == NPVariantType_Object) { NPObject* objectImp = NPVARIANT_TO_OBJECT(value); if (JavaInstance* instance = ExtractJavaInstance(objectImp)) - result.l = instance->getLocalRef(); + result.l = instance->javaInstance(); } // Now convert value to a string if the target type is a java.lang.string, and we're not -- cgit v1.1