summaryrefslogtreecommitdiffstats
path: root/V8Binding/v8
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/v8
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/v8')
-rw-r--r--V8Binding/v8/ScriptController.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/V8Binding/v8/ScriptController.h b/V8Binding/v8/ScriptController.h
index d26dbcc..40534fb 100644
--- a/V8Binding/v8/ScriptController.h
+++ b/V8Binding/v8/ScriptController.h
@@ -164,7 +164,7 @@ public:
// JSC has a WindowShell object, but for V8, the ScriptController
// is the WindowShell.
- bool haveWindowShell() const { return true; }
+ bool haveWindowShell() const { return m_proxy->ContextInitialized(); }
// Masquerade 'this' as the windowShell.
// This is a bit of a hack, but provides reasonable compatibility