diff options
author | Simon Hausmann <simon.hausmann@nokia.com> | 2012-05-11 09:43:24 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@nokia.com> | 2012-05-11 09:43:24 +0200 |
commit | 1b914638db989aaa98631a1c1e02c7b2d44805d8 (patch) | |
tree | 87f4fd2c7b38db320079a5de8877890d2ca3c485 /Source/WebCore/page/DOMWindowProperty.cpp | |
parent | 2cf6c8816a73e0132bd8fa3b509d62d7c51b6e47 (diff) | |
download | qtwebkit-1b914638db989aaa98631a1c1e02c7b2d44805d8.tar.gz |
Imported WebKit commit 9a52e27980f47e8b0d8f8b7cc0fd7b5741bceb92 (http://svn.webkit.org/repository/webkit/trunk@116736)
New snapshot to include QDeclarative* -> QQml* build fixes
Diffstat (limited to 'Source/WebCore/page/DOMWindowProperty.cpp')
-rw-r--r-- | Source/WebCore/page/DOMWindowProperty.cpp | 39 |
1 files changed, 34 insertions, 5 deletions
diff --git a/Source/WebCore/page/DOMWindowProperty.cpp b/Source/WebCore/page/DOMWindowProperty.cpp index 31ea44e7d..f4f32c29e 100644 --- a/Source/WebCore/page/DOMWindowProperty.cpp +++ b/Source/WebCore/page/DOMWindowProperty.cpp @@ -33,6 +33,7 @@ namespace WebCore { DOMWindowProperty::DOMWindowProperty(Frame* frame) : m_frame(frame) + , m_disconnectedDOMWindow(0) { if (m_frame) m_frame->domWindow()->registerProperty(this); @@ -40,25 +41,53 @@ DOMWindowProperty::DOMWindowProperty(Frame* frame) DOMWindowProperty::~DOMWindowProperty() { - if (m_frame) + if (m_frame) { + ASSERT(!m_disconnectedDOMWindow); m_frame->domWindow()->unregisterProperty(this); + } else if (m_disconnectedDOMWindow) + m_disconnectedDOMWindow->unregisterProperty(this); } -void DOMWindowProperty::disconnectFrame() +void DOMWindowProperty::disconnectFrameForPageCache() { + ASSERT(m_frame); + ASSERT(!m_disconnectedDOMWindow); + m_disconnectedDOMWindow = m_frame->domWindow(); m_frame = 0; } -void DOMWindowProperty::reconnectFrame(Frame* frame) +void DOMWindowProperty::reconnectFrameFromPageCache(Frame* frame) { ASSERT(frame); ASSERT(!m_frame); + ASSERT(m_disconnectedDOMWindow); m_frame = frame; + m_disconnectedDOMWindow = 0; +} + +void DOMWindowProperty::willDestroyGlobalObjectInCachedFrame() +{ + ASSERT(m_disconnectedDOMWindow); + // DOMWindowProperty lifetime isn't tied directly to the DOMWindow itself so it is important + // that it unregister itself from any DOMWindow it is associated with. + m_disconnectedDOMWindow->unregisterProperty(this); + m_disconnectedDOMWindow = 0; +} + +void DOMWindowProperty::willDestroyGlobalObjectInFrame() +{ + ASSERT(m_frame); + ASSERT(!m_disconnectedDOMWindow); + // DOMWindowProperty lifetime isn't tied directly to the DOMWindow itself so it is important that it unregister + // itself from any DOMWindow it is associated with. + m_frame->domWindow()->unregisterProperty(this); + m_frame = 0; } -void DOMWindowProperty::willDetachPage() +void DOMWindowProperty::willDetachGlobalObjectFromFrame() { - // Subclasses should override this function to handle this notification. + ASSERT(m_frame); + ASSERT(!m_disconnectedDOMWindow); } } |