summaryrefslogtreecommitdiffstats
path: root/WebCore/history
diff options
context:
space:
mode:
authorKristian Monsen <kristianm@google.com>2010-06-28 16:42:48 +0100
committerKristian Monsen <kristianm@google.com>2010-07-02 10:29:56 +0100
commit06ea8e899e48f1f2f396b70e63fae369f2f23232 (patch)
tree20c1428cd05c76f32394ab354ea35ed99acd86d8 /WebCore/history
parent72aad67af14193199e29cdd5c4ddc095a8b9a8a8 (diff)
downloadexternal_webkit-06ea8e899e48f1f2f396b70e63fae369f2f23232.zip
external_webkit-06ea8e899e48f1f2f396b70e63fae369f2f23232.tar.gz
external_webkit-06ea8e899e48f1f2f396b70e63fae369f2f23232.tar.bz2
Merge WebKit at r61871: Initial merge by git.
Change-Id: I6cff43abca9cc4782e088a469ad4f03f166a65d5
Diffstat (limited to 'WebCore/history')
-rw-r--r--WebCore/history/CachedFrame.cpp3
-rw-r--r--WebCore/history/HistoryItem.cpp17
-rw-r--r--WebCore/history/HistoryItem.h5
-rw-r--r--WebCore/history/PageCache.cpp9
4 files changed, 23 insertions, 11 deletions
diff --git a/WebCore/history/CachedFrame.cpp b/WebCore/history/CachedFrame.cpp
index 8881066..0be6710 100644
--- a/WebCore/history/CachedFrame.cpp
+++ b/WebCore/history/CachedFrame.cpp
@@ -129,9 +129,10 @@ CachedFrame::CachedFrame(Frame* frame)
// Custom scrollbar renderers will get reattached when the document comes out of the page cache
m_view->detachCustomScrollbars();
- m_document->documentWillBecomeInactive();
+ m_document->documentWillBecomeInactive();
frame->clearTimers();
m_document->setInPageCache(true);
+ frame->loader()->stopLoading(UnloadEventPolicyUnloadAndPageHide);
frame->loader()->client()->savePlatformDataToCachedFrame(this);
diff --git a/WebCore/history/HistoryItem.cpp b/WebCore/history/HistoryItem.cpp
index 03aa450..3ee423b 100644
--- a/WebCore/history/HistoryItem.cpp
+++ b/WebCore/history/HistoryItem.cpp
@@ -37,7 +37,7 @@
namespace WebCore {
-static long long generateDocumentSequenceNumber()
+static long long generateSequenceNumber()
{
// Initialize to the current time to reduce the likelihood of generating
// identifiers that overlap with those from past/future browser sessions.
@@ -57,7 +57,8 @@ HistoryItem::HistoryItem()
, m_lastVisitWasFailure(false)
, m_isTargetItem(false)
, m_visitCount(0)
- , m_documentSequenceNumber(generateDocumentSequenceNumber())
+ , m_itemSequenceNumber(generateSequenceNumber())
+ , m_documentSequenceNumber(generateSequenceNumber())
{
}
@@ -70,7 +71,8 @@ HistoryItem::HistoryItem(const String& urlString, const String& title, double ti
, m_lastVisitWasFailure(false)
, m_isTargetItem(false)
, m_visitCount(0)
- , m_documentSequenceNumber(generateDocumentSequenceNumber())
+ , m_itemSequenceNumber(generateSequenceNumber())
+ , m_documentSequenceNumber(generateSequenceNumber())
{
iconDatabase()->retainIconForPageURL(m_urlString);
}
@@ -85,7 +87,8 @@ HistoryItem::HistoryItem(const String& urlString, const String& title, const Str
, m_lastVisitWasFailure(false)
, m_isTargetItem(false)
, m_visitCount(0)
- , m_documentSequenceNumber(generateDocumentSequenceNumber())
+ , m_itemSequenceNumber(generateSequenceNumber())
+ , m_documentSequenceNumber(generateSequenceNumber())
{
iconDatabase()->retainIconForPageURL(m_urlString);
}
@@ -101,7 +104,8 @@ HistoryItem::HistoryItem(const KURL& url, const String& target, const String& pa
, m_lastVisitWasFailure(false)
, m_isTargetItem(false)
, m_visitCount(0)
- , m_documentSequenceNumber(generateDocumentSequenceNumber())
+ , m_itemSequenceNumber(generateSequenceNumber())
+ , m_documentSequenceNumber(generateSequenceNumber())
{
iconDatabase()->retainIconForPageURL(m_urlString);
}
@@ -133,7 +137,8 @@ inline HistoryItem::HistoryItem(const HistoryItem& item)
, m_visitCount(item.m_visitCount)
, m_dailyVisitCounts(item.m_dailyVisitCounts)
, m_weeklyVisitCounts(item.m_weeklyVisitCounts)
- , m_documentSequenceNumber(generateDocumentSequenceNumber())
+ , m_itemSequenceNumber(item.m_itemSequenceNumber)
+ , m_documentSequenceNumber(item.m_documentSequenceNumber)
, m_formContentType(item.m_formContentType)
{
if (item.m_formData)
diff --git a/WebCore/history/HistoryItem.h b/WebCore/history/HistoryItem.h
index ee8c0c8..ef73c5e 100644
--- a/WebCore/history/HistoryItem.h
+++ b/WebCore/history/HistoryItem.h
@@ -136,6 +136,9 @@ public:
void setStateObject(PassRefPtr<SerializedScriptValue> object);
SerializedScriptValue* stateObject() const { return m_stateObject.get(); }
+ void setItemSequenceNumber(long long number) { m_itemSequenceNumber = number; }
+ long long itemSequenceNumber() const { return m_itemSequenceNumber; }
+
void setDocumentSequenceNumber(long long number) { m_documentSequenceNumber = number; }
long long documentSequenceNumber() const { return m_documentSequenceNumber; }
@@ -242,6 +245,8 @@ private:
OwnPtr<Vector<String> > m_redirectURLs;
+ long long m_itemSequenceNumber;
+
// Support for HTML5 History
RefPtr<SerializedScriptValue> m_stateObject;
long long m_documentSequenceNumber;
diff --git a/WebCore/history/PageCache.cpp b/WebCore/history/PageCache.cpp
index 72fca86..7719187 100644
--- a/WebCore/history/PageCache.cpp
+++ b/WebCore/history/PageCache.cpp
@@ -36,6 +36,7 @@
#include "Frame.h"
#include "FrameLoader.h"
#include "FrameLoaderClient.h"
+#include "FrameLoaderStateMachine.h"
#include "HistoryItem.h"
#include "Logging.h"
#include "Page.h"
@@ -77,7 +78,7 @@ static void pageCacheLog(const String& prefix, const String& message)
static bool logCanCacheFrameDecision(Frame* frame, int indentLevel)
{
// Only bother logging for frames that have actually loaded and have content.
- if (frame->loader()->creatingInitialEmptyDocument())
+ if (frame->loader()->stateMachine()->creatingInitialEmptyDocument())
return false;
KURL currentURL = frame->loader()->documentLoader() ? frame->loader()->documentLoader()->url() : KURL();
if (currentURL.isEmpty())
@@ -102,7 +103,7 @@ static bool logCanCacheFrameDecision(Frame* frame, int indentLevel)
PCLOG(" -Main document has an error");
cannotCache = true;
}
- if (frame->loader()->containsPlugins()) {
+ if (frame->loader()->subframeLoader()->containsPlugins()) {
PCLOG(" -Frame contains plugins");
cannotCache = true;
}
@@ -175,7 +176,7 @@ static bool logCanCacheFrameDecision(Frame* frame, int indentLevel)
static void logCanCachePageDecision(Page* page)
{
// Only bother logging for main frames that have actually loaded and have content.
- if (page->mainFrame()->loader()->creatingInitialEmptyDocument())
+ if (page->mainFrame()->loader()->stateMachine()->creatingInitialEmptyDocument())
return;
KURL currentURL = page->mainFrame()->loader()->documentLoader() ? page->mainFrame()->loader()->documentLoader()->url() : KURL();
if (currentURL.isEmpty())
@@ -246,7 +247,7 @@ bool PageCache::canCachePageContainingThisFrame(Frame* frame)
// (objects created by the plug-in). Since there is no way to pause/resume a Netscape plug-in,
// 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()->containsPlugins()
+ && !frame->loader()->subframeLoader()->containsPlugins()
&& !frame->loader()->url().protocolIs("https")
&& (!frame->domWindow() || !frame->domWindow()->hasEventListeners(eventNames().unloadEvent))
#if ENABLE(DATABASE)