[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.16-1409-g5afdf4d
kenneth at webkit.org
kenneth at webkit.org
Thu Dec 3 13:22:34 UTC 2009
The following commit has been merged in the webkit-1.1 branch:
commit 3f1152bf6c2dd0a156aa8b22f70c9ae6931a1406
Author: kenneth at webkit.org <kenneth at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Thu Oct 29 13:23:23 2009 +0000
Serialize directly to the stream, and not first to an QByteArray,
that is later serialized. That is slower and also uses more bytes.
Patch by Kenneth Rohde Christiansen <kenneth at webkit.org> on 2009-10-28
Reviewed by Tor Arne Vestbø.
* Api/qwebhistory.cpp:
(operator<<):
(operator>>):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@50269 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebKit/qt/Api/qwebhistory.cpp b/WebKit/qt/Api/qwebhistory.cpp
index f765daa..d852012 100644
--- a/WebKit/qt/Api/qwebhistory.cpp
+++ b/WebKit/qt/Api/qwebhistory.cpp
@@ -494,22 +494,16 @@ QDataStream& operator<<(QDataStream& target, const QWebHistory& history)
{
QWebHistoryPrivate* d = history.d;
- QByteArray buffer;
- QDataStream stream(&buffer, QIODevice::WriteOnly);
-
int version = DefaultHistoryVersion;
- stream << version;
- stream << history.count() << history.currentItemIndex();
+ target << version;
+ target << history.count() << history.currentItemIndex();
const WebCore::HistoryItemVector &items = d->lst->entries();
for (unsigned i = 0; i < items.size(); i++)
- items[i].get()->saveState(stream, version);
-
- if (stream.status() != QDataStream::Ok)
- buffer = QByteArray(); // make buffer isNull()==true and isEmpty()==true
+ items[i].get()->saveState(target, version);
- return target << buffer;
+ return target;
}
/*!
@@ -526,18 +520,14 @@ QDataStream& operator>>(QDataStream& source, QWebHistory& history)
{
QWebHistoryPrivate* d = history.d;
- QByteArray buffer;
- source >> buffer;
-
- QDataStream stream(buffer);
int version;
- stream >> version;
+ source >> version;
if (version == 1) {
int count;
int currentIndex;
- stream >> count >> currentIndex;
+ source >> count >> currentIndex;
history.clear();
// only if there are elements
@@ -546,7 +536,7 @@ QDataStream& operator>>(QDataStream& source, QWebHistory& history)
WebCore::HistoryItem* nullItem = d->lst->currentItem();
for (int i = 0; i < count; i++) {
WTF::PassRefPtr<WebCore::HistoryItem> item = WebCore::HistoryItem::create();
- item->restoreState(stream, version);
+ item->restoreState(source, version);
d->lst->addItem(item);
}
d->lst->removeItem(nullItem);
diff --git a/WebKit/qt/ChangeLog b/WebKit/qt/ChangeLog
index 67cf7f3..fc2913d 100644
--- a/WebKit/qt/ChangeLog
+++ b/WebKit/qt/ChangeLog
@@ -1,3 +1,14 @@
+2009-10-28 Kenneth Rohde Christiansen <kenneth at webkit.org>
+
+ Reviewed by Tor Arne Vestbø.
+
+ Serialize directly to the stream, and not first to an QByteArray,
+ that is later serialized. That is slower and also uses more bytes.
+
+ * Api/qwebhistory.cpp:
+ (operator<<):
+ (operator>>):
+
2009-10-28 Shinichiro Hamaji <hamaji at chromium.org>
Reviewed by Eric Seidel.
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list