void HistoryItem::encodeBackForwardTreeNode(Encoder& encoder) const { size_t size = m_children.size(); encoder.encodeUInt64(size); for (size_t i = 0; i < size; ++i) { const HistoryItem& child = *m_children[i]; encoder.encodeString(child.m_originalURLString); encoder.encodeString(child.m_urlString); child.encodeBackForwardTreeNode(encoder); } encoder.encodeInt64(m_documentSequenceNumber); size = m_documentState.size(); encoder.encodeUInt64(size); for (size_t i = 0; i < size; ++i) encoder.encodeString(m_documentState[i]); encoder.encodeString(m_formContentType); encoder.encodeBool(m_formData); if (m_formData) m_formData->encodeForBackForward(encoder); encoder.encodeInt64(m_itemSequenceNumber); encoder.encodeString(m_referrer); encoder.encodeInt32(m_scrollPoint.x()); encoder.encodeInt32(m_scrollPoint.y()); encoder.encodeFloat(m_pageScaleFactor); encoder.encodeBool(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); }
void FormData::encode(Encoder& encoder) const { encoder.encodeBool(m_alwaysStream); encoder.encodeBytes(reinterpret_cast<const uint8_t*>(m_boundary.data()), m_boundary.size()); size_t size = m_elements.size(); encoder.encodeUInt64(size); for (size_t i = 0; i < size; ++i) encodeElement(encoder, m_elements[i]); encoder.encodeBool(hasGeneratedFiles()); // For backward compatibility. encoder.encodeInt64(m_identifier); }