Try to fix Chromium build.
[WebKit-https.git] / WebCore / history / HistoryItem.cpp
index 5899aff..bbe6a5d 100644 (file)
@@ -669,8 +669,13 @@ void HistoryItem::encodeBackForwardTreeNode(Encoder* encoder) const
     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());
+#else
+        encoder->encodeString(m_stateObject->toWireString());
+#endif
+    }
 
     encoder->encodeString(m_target);
 }
@@ -776,10 +781,17 @@ resume:
     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);
+#else
+        String string;
+        if (!decoder->decodeString(string))
+            return 0;
+        node->m_stateObject = SerializedScriptValue::createFromWire(string);
+#endif
     }
 
     if (!decoder->decodeString(node->m_target))