summaryrefslogtreecommitdiffstats
path: root/Source/WebCore/history
diff options
context:
space:
mode:
authorSteve Block <steveblock@google.com>2011-05-18 13:36:51 +0100
committerSteve Block <steveblock@google.com>2011-05-24 15:38:28 +0100
commit2fc2651226baac27029e38c9d6ef883fa32084db (patch)
treee396d4bf89dcce6ed02071be66212495b1df1dec /Source/WebCore/history
parentb3725cedeb43722b3b175aaeff70552e562d2c94 (diff)
downloadexternal_webkit-2fc2651226baac27029e38c9d6ef883fa32084db.zip
external_webkit-2fc2651226baac27029e38c9d6ef883fa32084db.tar.gz
external_webkit-2fc2651226baac27029e38c9d6ef883fa32084db.tar.bz2
Merge WebKit at r78450: Initial merge by git.
Change-Id: I6d3e5f1f868ec266a0aafdef66182ddc3f265dc1
Diffstat (limited to 'Source/WebCore/history')
-rw-r--r--Source/WebCore/history/CachedFrame.cpp18
-rw-r--r--Source/WebCore/history/HistoryItem.cpp7
-rw-r--r--Source/WebCore/history/HistoryItem.h1
-rw-r--r--Source/WebCore/history/PageCache.cpp4
4 files changed, 14 insertions, 16 deletions
diff --git a/Source/WebCore/history/CachedFrame.cpp b/Source/WebCore/history/CachedFrame.cpp
index ab6b4d6..0059691 100644
--- a/Source/WebCore/history/CachedFrame.cpp
+++ b/Source/WebCore/history/CachedFrame.cpp
@@ -65,7 +65,7 @@ CachedFrameBase::CachedFrameBase(Frame* frame)
, m_documentLoader(frame->loader()->documentLoader())
, m_view(frame->view())
, m_mousePressNode(frame->eventHandler()->mousePressNode())
- , m_url(frame->loader()->url())
+ , m_url(frame->document()->url())
, m_isMainFrame(!frame->tree()->parent())
{
}
@@ -135,10 +135,6 @@ CachedFrame::CachedFrame(Frame* frame)
if (frame->page()->focusController()->focusedFrame() == frame)
frame->page()->focusController()->setFocusedFrame(frame->page()->mainFrame());
- // Active DOM objects must be suspended before we cached the frame script data
- m_document->suspendActiveDOMObjects(ActiveDOMObject::DocumentWillBecomeInactive);
- m_cachedFrameScriptData = adoptPtr(new ScriptCachedFrameData(frame));
-
// Custom scrollbar renderers will get reattached when the document comes out of the page cache
m_view->detachCustomScrollbars();
@@ -146,13 +142,21 @@ CachedFrame::CachedFrame(Frame* frame)
frame->clearTimers();
m_document->setInPageCache(true);
frame->loader()->stopLoading(UnloadEventPolicyUnloadAndPageHide);
-
- frame->loader()->client()->savePlatformDataToCachedFrame(this);
// Create the CachedFrames for all Frames in the FrameTree.
for (Frame* child = frame->tree()->firstChild(); child; child = child->tree()->nextSibling())
m_childFrames.append(CachedFrame::create(child));
+ // Active DOM objects must be suspended before we cache the frame script data,
+ // but after we've fired the pagehide event, in case that creates more objects.
+ // Suspending must also happen after we've recursed over child frames, in case
+ // those create more objects.
+ // FIXME: It's still possible to have objects created after suspending in some cases, see http://webkit.org/b/53733 for more details.
+ m_document->suspendActiveDOMObjects(ActiveDOMObject::DocumentWillBecomeInactive);
+ m_cachedFrameScriptData = adoptPtr(new ScriptCachedFrameData(frame));
+
+ frame->loader()->client()->savePlatformDataToCachedFrame(this);
+
// Deconstruct the FrameTree, to restore it later.
// We do this for two reasons:
// 1 - We reuse the main frame, so when it navigates to a new page load it needs to start with a blank FrameTree.
diff --git a/Source/WebCore/history/HistoryItem.cpp b/Source/WebCore/history/HistoryItem.cpp
index 805d5aa..c698db3 100644
--- a/Source/WebCore/history/HistoryItem.cpp
+++ b/Source/WebCore/history/HistoryItem.cpp
@@ -40,7 +40,7 @@
namespace WebCore {
-const uint32_t backForwardTreeEncodingVersion = 1;
+const uint32_t backForwardTreeEncodingVersion = 2;
static long long generateSequenceNumber()
{
@@ -716,8 +716,6 @@ void HistoryItem::encodeBackForwardTreeNode(Encoder& encoder) const
encoder.encodeInt64(m_itemSequenceNumber);
- encoder.encodeString(m_originalURLString);
-
encoder.encodeString(m_referrer);
encoder.encodeInt32(m_scrollPoint.x());
@@ -820,9 +818,6 @@ resume:
if (!decoder.decodeInt64(node->m_itemSequenceNumber))
return 0;
- if (!decoder.decodeString(node->m_originalURLString))
- return 0;
-
if (!decoder.decodeString(node->m_referrer))
return 0;
diff --git a/Source/WebCore/history/HistoryItem.h b/Source/WebCore/history/HistoryItem.h
index 526cae2..235f756 100644
--- a/Source/WebCore/history/HistoryItem.h
+++ b/Source/WebCore/history/HistoryItem.h
@@ -234,7 +234,6 @@ private:
HistoryItem* findTargetItem();
void encodeBackForwardTreeNode(Encoder&) const;
- static PassRefPtr<HistoryItem> decodeBackForwardTreeNode(const String& urlString, const String& title, const String& originalURLString, Decoder&);
/* When adding new member variables to this class, please notify the Qt team.
* qt/HistoryItemQt.cpp contains code to serialize history items.
diff --git a/Source/WebCore/history/PageCache.cpp b/Source/WebCore/history/PageCache.cpp
index a5dfb1e..d57df65 100644
--- a/Source/WebCore/history/PageCache.cpp
+++ b/Source/WebCore/history/PageCache.cpp
@@ -111,7 +111,7 @@ static bool logCanCacheFrameDecision(Frame* frame, int indentLevel)
PCLOG(" -Frame contains plugins");
cannotCache = true;
}
- if (frame->loader()->url().protocolIs("https")) {
+ if (frame->document()->url().protocolIs("https")) {
PCLOG(" -Frame is HTTPS");
cannotCache = true;
}
@@ -260,7 +260,7 @@ bool PageCache::canCachePageContainingThisFrame(Frame* frame)
// they would need to be destroyed and then recreated, and there is no way that we can recreate
// the right NPObjects. See <rdar://problem/5197041> for more information.
&& !frame->loader()->subframeLoader()->containsPlugins()
- && !frame->loader()->url().protocolIs("https")
+ && !frame->document()->url().protocolIs("https")
&& (!frame->domWindow() || !frame->domWindow()->hasEventListeners(eventNames().unloadEvent))
#if ENABLE(DATABASE)
&& !frame->document()->hasOpenDatabases()