From a43df009713c7df7b19336db5cee8306da62d186 Mon Sep 17 00:00:00 2001 From: Jocelyn Turcotte Date: Tue, 13 Apr 2010 16:19:29 +0200 Subject: QtWebKit: Fix the QWebHistory serialization auto-test This patch should be overwritten by the next WebKit import. Reviewed-by: Kent Hansen --- .../webkit/WebCore/history/qt/HistoryItemQt.cpp | 21 ++++++++++++++------- src/3rdparty/webkit/WebKit/qt/Api/qwebhistory.cpp | 4 ++-- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/src/3rdparty/webkit/WebCore/history/qt/HistoryItemQt.cpp b/src/3rdparty/webkit/WebCore/history/qt/HistoryItemQt.cpp index c5fb069..8bbd233 100644 --- a/src/3rdparty/webkit/WebCore/history/qt/HistoryItemQt.cpp +++ b/src/3rdparty/webkit/WebCore/history/qt/HistoryItemQt.cpp @@ -25,9 +25,8 @@ bool WebCore::HistoryItem::restoreState(QDataStream& in, int version) { - // we only support version 1 for now - - if (version != 1) + // we support up to version 2 + if (version > 2) return false; WebCore::String url; @@ -48,6 +47,7 @@ bool WebCore::HistoryItem::restoreState(QDataStream& in, int version) WebCore::IntPoint scrollPoint; WTF::Vector weeklyVisitCounts; WTF::Vector dailyVisitCounts; + long long documentSequenceNumber; // bool loadFormdata; // WebCore::String formContentType; // WTF::Vector formData; @@ -79,6 +79,12 @@ bool WebCore::HistoryItem::restoreState(QDataStream& in, int version) setTitle(title); setAlternateTitle(altTitle); + if (version > 1) + { + in >> documentSequenceNumber; + setDocumentSequenceNumber(documentSequenceNumber); + } + // at the end load userData in >> validUserData; if (validUserData) { @@ -92,15 +98,16 @@ bool WebCore::HistoryItem::restoreState(QDataStream& in, int version) QDataStream& WebCore::HistoryItem::saveState(QDataStream& out, int version) const { - // we only support version 1 for now. - if (version != 1) - return out; - out << urlString() << title() << alternateTitle() << lastVisitedTime(); out << originalURLString() << referrer() << target() << parent(); out << lastVisitWasHTTPNonGet() << lastVisitWasFailure() << isTargetItem(); out << visitCount() << documentState() << scrollPoint(); out << dailyVisitCounts() << weeklyVisitCounts(); + + // Since version 2 + Q_ASSERT_X(version > 1, "HistoryItem::saveState()", "Stream version should be greater than 1"); + out << documentSequenceNumber(); + /*if (m_formData) { out << true; out << formContentType(); diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebhistory.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qwebhistory.cpp index d852012..61ec9d2 100644 --- a/src/3rdparty/webkit/WebKit/qt/Api/qwebhistory.cpp +++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebhistory.cpp @@ -33,7 +33,7 @@ enum { InitialHistoryVersion = 1, - DefaultHistoryVersion = InitialHistoryVersion + DefaultHistoryVersion = 2 }; /*! @@ -524,7 +524,7 @@ QDataStream& operator>>(QDataStream& source, QWebHistory& history) source >> version; - if (version == 1) { + if (version <= 2) { int count; int currentIndex; source >> count >> currentIndex; -- cgit v0.12