From 12db9a6492824cedb54ec0cd640e686a7af09e91 Mon Sep 17 00:00:00 2001 From: Ed Heyl Date: Tue, 8 Mar 2011 23:03:03 -0800 Subject: cherry-pick this change from master (should be in honeycomb-mr1) (please don't merge) Avoid Android modifications to JavaNPObjectV8.cpp/h https://android-git.corp.google.com/g/40387 fixed a long-standing bug to avoid leaking references to injected Java objects. However, it did so by making changes to JavaNPObjectV8.cpp/h which were never upstreamed. This change avoids the need for these changes. This change also avoids the use of a local PassRefPtr, which was incorrectly introduced in https://android-git.corp.google.com/g/36204. Change-Id: Ia1e3245a953826bbfd8e085f7ed1b1341228255d --- WebCore/bridge/jni/v8/JavaNPObjectV8.cpp | 4 +--- WebCore/bridge/jni/v8/JavaNPObjectV8.h | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) (limited to 'WebCore/bridge') diff --git a/WebCore/bridge/jni/v8/JavaNPObjectV8.cpp b/WebCore/bridge/jni/v8/JavaNPObjectV8.cpp index 7aa55b5..3bb8e27 100644 --- a/WebCore/bridge/jni/v8/JavaNPObjectV8.cpp +++ b/WebCore/bridge/jni/v8/JavaNPObjectV8.cpp @@ -68,9 +68,7 @@ static NPClass JavaNPObjectClass = { 0 // construct }; -// ANDROID-specific change. TODO: Upstream -NPObject* JavaInstanceToNPObject(PassRefPtr instance) -// END ANDROID-specific change +NPObject* JavaInstanceToNPObject(JavaInstance* instance) { JavaNPObject* object = reinterpret_cast(_NPN_CreateObject(0, &JavaNPObjectClass)); object->m_instance = instance; diff --git a/WebCore/bridge/jni/v8/JavaNPObjectV8.h b/WebCore/bridge/jni/v8/JavaNPObjectV8.h index e68a5aa..31b0ac7 100644 --- a/WebCore/bridge/jni/v8/JavaNPObjectV8.h +++ b/WebCore/bridge/jni/v8/JavaNPObjectV8.h @@ -41,9 +41,7 @@ struct JavaNPObject { RefPtr m_instance; }; -// ANDROID-specific change. TODO: Upstream -NPObject* JavaInstanceToNPObject(PassRefPtr); -// END ANDROID-specific change +NPObject* JavaInstanceToNPObject(JavaInstance*); JavaInstance* ExtractJavaInstance(NPObject*); bool JavaNPObjectHasMethod(NPObject*, NPIdentifier name); -- cgit v1.1