summaryrefslogtreecommitdiffstats
path: root/V8Binding
diff options
context:
space:
mode:
authorFeng Qian <fqian@google.com>2009-07-17 15:49:21 -0700
committerFeng Qian <fqian@google.com>2009-07-17 15:49:21 -0700
commit43a7f61745b1d0d874970688902b83232605554a (patch)
tree82f39343673c91ea945a49cc27bd2a461f0f3aed /V8Binding
parentf86737b0ce8c81f2b529503f83eb8b064769eeca (diff)
downloadexternal_webkit-43a7f61745b1d0d874970688902b83232605554a.zip
external_webkit-43a7f61745b1d0d874970688902b83232605554a.tar.gz
external_webkit-43a7f61745b1d0d874970688902b83232605554a.tar.bz2
Initialize context if a frame had an empty global object.
When a frame navigates to a new page, the global object is detached from its old context. However, if the new page has no JavaScript, its new context is not initialized. If another page kept a reference to the global object of the old page and tries to access the new page, it will fail because the context of new page is not initialized so the global object is connected to a real context.
Diffstat (limited to 'V8Binding')
-rw-r--r--V8Binding/binding/v8_proxy.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/V8Binding/binding/v8_proxy.cpp b/V8Binding/binding/v8_proxy.cpp
index c0de3c6..8675d6f 100644
--- a/V8Binding/binding/v8_proxy.cpp
+++ b/V8Binding/binding/v8_proxy.cpp
@@ -2011,9 +2011,11 @@ void V8Proxy::updateDocument()
if (!m_frame->document())
return;
- if (m_context.IsEmpty())
+ if (m_global.IsEmpty())
return;
+ InitContextIfNeeded();
+
// We have a new document and we need to update the cache.
UpdateDocumentWrapperCache();