[SCM] WebKit Debian packaging branch, webkit-1.2, updated. upstream/1.1.90-6072-g9a69373

kenneth at webkit.org kenneth at webkit.org
Wed Apr 7 23:14:27 UTC 2010


The following commit has been merged in the webkit-1.2 branch:
commit 4b623cd771514c1a71a331099fe8fb8dd32c8e8e
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