[SCM] WebKit Debian packaging branch, webkit-1.3, updated. upstream/1.3.7-4207-g178b198

aroben at apple.com aroben at apple.com
Mon Feb 21 00:39:38 UTC 2011


The following commit has been merged in the webkit-1.3 branch:
commit bd1f62379ac7ebe2fd7aad406d48c0c2b7a49193
Author: aroben at apple.com <aroben at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Feb 2 20:33:51 2011 +0000

    Encode/decode FormData and FormDataElement objects consistently
    
    Fixes <http://webkit.org/b/53615> <rdar://problem/8943346> WebKit2: Restoring session state
    that contains form data fails (asserts in Debug build)
    
    To prevent this from interfering with WebKit2 testing, it's useful to get this into a build
    now, even though we don't have an automated test for it yet. Writing a test is covered by
    <http://webkit.org/b/53616>.
    
    Reviewed by Darin Adler.
    
    * history/HistoryItem.cpp: Bump the encoding version, since this patch changes how we encode
    FormData objects.
    
    * platform/network/FormData.cpp:
    (WebCore::decode): Decode the type from the Decoder, rather than getting it from the
    default-constructed FormDataElement. Failing to do this meant that all future uses of the
    Decoder would be reading from an unexpected part of the buffer (i.e., the next decode would
    start by reading the uint32_t that we forgot to decode here, and so on). We already had code
    to correctly set the FormDataElement's type based on this decoded type later in the
    function.
    (WebCore::FormData::encodeForBackForward): Encode m_identifier as an int64_t, since that
    matches its type and how we decode it.
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@77401 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog
index dae16cb..036dd56 100644
--- a/Source/WebCore/ChangeLog
+++ b/Source/WebCore/ChangeLog
@@ -1,3 +1,29 @@
+2011-02-02  Adam Roben  <aroben at apple.com>
+
+        Encode/decode FormData and FormDataElement objects consistently
+
+        Fixes <http://webkit.org/b/53615> <rdar://problem/8943346> WebKit2: Restoring session state
+        that contains form data fails (asserts in Debug build)
+
+        To prevent this from interfering with WebKit2 testing, it's useful to get this into a build
+        now, even though we don't have an automated test for it yet. Writing a test is covered by
+        <http://webkit.org/b/53616>.
+
+        Reviewed by Darin Adler.
+
+        * history/HistoryItem.cpp: Bump the encoding version, since this patch changes how we encode
+        FormData objects.
+
+        * platform/network/FormData.cpp:
+        (WebCore::decode): Decode the type from the Decoder, rather than getting it from the
+        default-constructed FormDataElement. Failing to do this meant that all future uses of the
+        Decoder would be reading from an unexpected part of the buffer (i.e., the next decode would
+        start by reading the uint32_t that we forgot to decode here, and so on). We already had code
+        to correctly set the FormDataElement's type based on this decoded type later in the
+        function.
+        (WebCore::FormData::encodeForBackForward): Encode m_identifier as an int64_t, since that
+        matches its type and how we decode it.
+
 2011-02-02  Dan Winship  <danw at gnome.org>
 
         Reviewed by Martin Robinson.
diff --git a/Source/WebCore/history/HistoryItem.cpp b/Source/WebCore/history/HistoryItem.cpp
index 3b76943..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()
 {
diff --git a/Source/WebCore/platform/network/FormData.cpp b/Source/WebCore/platform/network/FormData.cpp
index 16f98ad..bdc4b03 100644
--- a/Source/WebCore/platform/network/FormData.cpp
+++ b/Source/WebCore/platform/network/FormData.cpp
@@ -364,7 +364,9 @@ static void encode(Encoder& encoder, const FormDataElement& element)
 
 static bool decode(Decoder& decoder, FormDataElement& element)
 {
-    uint32_t type = element.m_type;
+    uint32_t type;
+    if (!decoder.decodeUInt32(type))
+        return false;
 
     switch (type) {
     case FormDataElement::data: {
@@ -432,7 +434,7 @@ void FormData::encodeForBackForward(Encoder& encoder) const
 
     encoder.encodeBool(m_hasGeneratedFiles);
 
-    encoder.encodeBool(m_identifier);
+    encoder.encodeInt64(m_identifier);
 }
 
 PassRefPtr<FormData> FormData::decodeForBackForward(Decoder& decoder)

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list