diff options
author | Android (Google) Code Review <android-gerrit@google.com> | 2009-12-03 15:47:48 -0800 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2009-12-03 15:47:48 -0800 |
commit | 472affe311f3854aaac7cca73d398d36a9eefaf3 (patch) | |
tree | 580cad7a82834870ded5f822f992464b2dcd9d24 /WebCore/loader/FrameLoader.cpp | |
parent | d262e1f9241778a6d0483945a3e125636cedfb70 (diff) | |
parent | ceb63592c5a89c8ee5e3cc6bb2186474c678fb0f (diff) | |
download | external_webkit-472affe311f3854aaac7cca73d398d36a9eefaf3.zip external_webkit-472affe311f3854aaac7cca73d398d36a9eefaf3.tar.gz external_webkit-472affe311f3854aaac7cca73d398d36a9eefaf3.tar.bz2 |
Merge change Iceb63592 into eclair-mr2
* changes:
Experimental change. Cache pages with unload event for back/forward. This will improve the history navigation. But it may break some sites. See discussion in https://bugs.webkit.org/show_bug.cgi?id=29021.
Diffstat (limited to 'WebCore/loader/FrameLoader.cpp')
-rw-r--r-- | WebCore/loader/FrameLoader.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/WebCore/loader/FrameLoader.cpp b/WebCore/loader/FrameLoader.cpp index f9dc2bf..93ada45 100644 --- a/WebCore/loader/FrameLoader.cpp +++ b/WebCore/loader/FrameLoader.cpp @@ -530,7 +530,9 @@ void FrameLoader::stopLoading(UnloadEventPolicy unloadEventPolicy, DatabasePolic if (m_frame->domWindow()) { if (unloadEventPolicy == UnloadEventPolicyUnloadAndPageHide) m_frame->domWindow()->dispatchEvent(PageTransitionEvent::create(EventNames().pagehideEvent, m_frame->document()->inPageCache()), m_frame->document()); +#ifndef ANDROID_PAGE_CACHE_UNLOAD if (!m_frame->document()->inPageCache()) +#endif m_frame->domWindow()->dispatchEvent(Event::create(eventNames().unloadEvent, false, false), m_frame->domWindow()->document()); } m_unloadEventBeingDispatched = false; @@ -1523,7 +1525,9 @@ bool FrameLoader::canCachePageContainingThisFrame() // the right NPObjects. See <rdar://problem/5197041> for more information. && !m_containsPlugIns && !m_URL.protocolIs("https") +#ifndef ANDROID_PAGE_CACHE_UNLOAD && (!m_frame->domWindow() || !m_frame->domWindow()->hasEventListeners(eventNames().unloadEvent)) +#endif #if ENABLE(DATABASE) && !m_frame->document()->hasOpenDatabases() #endif @@ -1668,8 +1672,10 @@ bool FrameLoader::logCanCacheFrameDecision(int indentLevel) { PCLOG(" -Frame contains plugins"); cannotCache = true; } if (m_URL.protocolIs("https")) { PCLOG(" -Frame is HTTPS"); cannotCache = true; } +#ifndef ANDROID_PAGE_CACHE_UNLOAD if (m_frame->domWindow() && m_frame->domWindow()->hasEventListeners(eventNames().unloadEvent)) { PCLOG(" -Frame has an unload event listener"); cannotCache = true; } +#endif #if ENABLE(DATABASE) if (m_frame->document()->hasOpenDatabases()) { PCLOG(" -Frame has open database handles"); cannotCache = true; } |