Try to fix Chromium build.
authordarin@apple.com <darin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 4 Jan 2011 05:36:26 +0000 (05:36 +0000)
committerdarin@apple.com <darin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 4 Jan 2011 05:36:26 +0000 (05:36 +0000)
* history/HistoryItem.cpp:
(WebCore::HistoryItem::encodeBackForwardTreeNode): Added a V8 case here.
Not sure this ever will be used with V8.
(WebCore::HistoryItem::decodeBackForwardTree): Ditto.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@74956 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebCore/ChangeLog
WebCore/history/HistoryItem.cpp

index 5c63523..4ec1d62 100644 (file)
@@ -1,5 +1,14 @@
 2011-01-03  Darin Adler  <darin@apple.com>
 
 2011-01-03  Darin Adler  <darin@apple.com>
 
+        Try to fix Chromium build.
+
+        * history/HistoryItem.cpp:
+        (WebCore::HistoryItem::encodeBackForwardTreeNode): Added a V8 case here.
+        Not sure this ever will be used with V8.
+        (WebCore::HistoryItem::decodeBackForwardTree): Ditto.
+
+2011-01-03  Darin Adler  <darin@apple.com>
+
         Try to fix Leopard build.
 
         * history/HistoryItem.cpp: Use a consistent type, uint64_t, for the
         Try to fix Leopard build.
 
         * history/HistoryItem.cpp: Use a consistent type, uint64_t, for the
index 5899aff..bbe6a5d 100644 (file)
@@ -669,8 +669,13 @@ void HistoryItem::encodeBackForwardTreeNode(Encoder* encoder) const
     encoder->encodeInt32(m_scrollPoint.y());
 
     encoder->encodeBool(m_stateObject);
     encoder->encodeInt32(m_scrollPoint.y());
 
     encoder->encodeBool(m_stateObject);
-    if (m_stateObject)
+    if (m_stateObject) {
+#if !USE(V8)
         encoder->encodeBytes(m_stateObject->data().data(), m_stateObject->data().size());
         encoder->encodeBytes(m_stateObject->data().data(), m_stateObject->data().size());
+#else
+        encoder->encodeString(m_stateObject->toWireString());
+#endif
+    }
 
     encoder->encodeString(m_target);
 }
 
     encoder->encodeString(m_target);
 }
@@ -776,10 +781,17 @@ resume:
     if (!decoder->decodeBool(hasStateObject))
         return 0;
     if (hasStateObject) {
     if (!decoder->decodeBool(hasStateObject))
         return 0;
     if (hasStateObject) {
+#if !USE(V8)
         Vector<uint8_t> bytes;
         if (!decoder->decodeBytes(bytes))
             return 0;
         node->m_stateObject = SerializedScriptValue::adopt(bytes);
         Vector<uint8_t> bytes;
         if (!decoder->decodeBytes(bytes))
             return 0;
         node->m_stateObject = SerializedScriptValue::adopt(bytes);
+#else
+        String string;
+        if (!decoder->decodeString(string))
+            return 0;
+        node->m_stateObject = SerializedScriptValue::createFromWire(string);
+#endif
     }
 
     if (!decoder->decodeString(node->m_target))
     }
 
     if (!decoder->decodeString(node->m_target))