summaryrefslogtreecommitdiffstats
path: root/V8Binding/jni/jni_runtime.cpp
diff options
context:
space:
mode:
authorFeng Qian <fqian@google.com>2009-05-05 11:52:10 -0700
committerFeng Qian <fqian@google.com>2009-05-06 11:29:33 -0700
commite8f342c7034cddf274ba5b9e18c51dd3e29c7db9 (patch)
treeab0a7960fef47b124d786bb5c29c4fbd30882244 /V8Binding/jni/jni_runtime.cpp
parent8d56b03700596845df1a6ba952aa7ad4b1cdccca (diff)
downloadexternal_webkit-e8f342c7034cddf274ba5b9e18c51dd3e29c7db9.zip
external_webkit-e8f342c7034cddf274ba5b9e18c51dd3e29c7db9.tar.gz
external_webkit-e8f342c7034cddf274ba5b9e18c51dd3e29c7db9.tar.bz2
Fix memory leaks in Java binding and some code cleanup.
WebCoreFrameBridge.cpp needs to release NPObject to get proper ref count because the way V8 binding works. JObjectWraper holds a weak reference to the Java object to break cycles. Also fix ScriptController::haveWindowShell to match KJS build, this should be upstreamed to Chrome project (I am going to do it). The binding does not use weak reference to hold Java objects, currently it does not create cycles between Java and JavaScript objects. I didn't see it is an issue here. A future work is to add logging/debugging code to make sure global Java references are dropped.
Diffstat (limited to 'V8Binding/jni/jni_runtime.cpp')
-rw-r--r--V8Binding/jni/jni_runtime.cpp11
1 files changed, 0 insertions, 11 deletions
diff --git a/V8Binding/jni/jni_runtime.cpp b/V8Binding/jni/jni_runtime.cpp
index 9c87c54..2fbcc5d 100644
--- a/V8Binding/jni/jni_runtime.cpp
+++ b/V8Binding/jni/jni_runtime.cpp
@@ -29,15 +29,6 @@
#include "jni_runtime.h"
#include "jni_utility.h"
-#ifdef NDEBUG
-#define JS_LOG(formatAndArgs...) ((void)0)
-#else
-#define JS_LOG(formatAndArgs...) { \
- fprintf (stderr, "%s:%d -- %s: ", __FILE__, __LINE__, __FUNCTION__); \
- fprintf(stderr, formatAndArgs); \
-}
-#endif
-
using namespace JSC::Bindings;
JavaParameter::JavaParameter (JNIEnv *env, jstring type)
@@ -100,9 +91,7 @@ JavaMethod::JavaMethod (JNIEnv *env, jobject aMethod)
jclass modifierClass = env->FindClass("java/lang/reflect/Modifier");
int modifiers = callJNIMethod<jint>(aMethod, "getModifiers", "()I");
_isStatic = (bool)callJNIStaticMethod<jboolean>(modifierClass, "isStatic", "(I)Z", modifiers);
-#ifdef ANDROID_FIX
env->DeleteLocalRef(modifierClass);
-#endif
}
JavaMethod::~JavaMethod()