diff options
author | Steve Block <steveblock@google.com> | 2009-12-18 12:28:23 +0000 |
---|---|---|
committer | Steve Block <steveblock@google.com> | 2010-01-08 16:22:49 +0000 |
commit | 88d4517612dafdcaff7a98f2a68ff071e2734ea6 (patch) | |
tree | 6bf4ebf254be2f5726d1d42fb7b5868969047cb9 /WebCore | |
parent | 621d19b254dc27a490101dcc947c9a29517af899 (diff) | |
download | external_webkit-88d4517612dafdcaff7a98f2a68ff071e2734ea6.zip external_webkit-88d4517612dafdcaff7a98f2a68ff071e2734ea6.tar.gz external_webkit-88d4517612dafdcaff7a98f2a68ff071e2734ea6.tar.bz2 |
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
Diffstat (limited to 'WebCore')
-rw-r--r-- | WebCore/bridge/jni/v8/jni_utility_private.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
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 |