Commit c9bf05d8 authored by darin@apple.com's avatar darin@apple.com

2011-01-04 Darin Adler <darin@apple.com>

        Reviewed by Brady Eidson.

        Add back/forward encoding and decoding to WebKit2
        https://bugs.webkit.org/show_bug.cgi?id=51901

        * WebCore.exp.in: Export functions used in WebKit2.

        * history/HistoryItem.cpp:
        (WebCore::HistoryItem::encodeBackForwardTree): Use references instead of pointers.
        (WebCore::HistoryItem::encodeBackForwardTreeNode): Ditto.
        (WebCore::HistoryItem::decodeBackForwardTree): Ditto.
        * history/HistoryItem.h: Ditto.
        * platform/network/FormData.cpp:
        (WebCore::encode): Ditto.
        (WebCore::decode): Ditto.
        (WebCore::FormData::encodeForBackForward): Ditto.
        (WebCore::FormData::decodeForBackForward): Ditto.
        * platform/network/FormData.h: Ditto.
2011-01-04  Darin Adler  <darin@apple.com>

        Reviewed by Brady Eidson.

        Add back/forward encoding and decoding to WebKit2
        https://bugs.webkit.org/show_bug.cgi?id=51901

        * GNUmakefile.am: Added new source files.
        * WebKit2.pro: Ditto.
        * WebKit2.xcodeproj/project.pbxproj: Ditto.
        * win/WebKit2.vcproj: Ditto.

        * WebProcess/WebPage/DecoderAdapter.cpp: Added.
        * WebProcess/WebPage/DecoderAdapter.h: Added.
        * WebProcess/WebPage/EncoderAdapter.cpp: Added.
        * WebProcess/WebPage/EncoderAdapter.h: Added.

        * WebProcess/WebPage/WebBackForwardListProxy.cpp:
        (WebKit::updateBackForwardItem): Added code to encode the back/forward
        tree and send it along. The code to decode needs to wait on Brady's
        current project.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@75020 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent d4871371
2011-01-04 Darin Adler <darin@apple.com>
Reviewed by Brady Eidson.
Add back/forward encoding and decoding to WebKit2
https://bugs.webkit.org/show_bug.cgi?id=51901
* WebCore.exp.in: Export functions used in WebKit2.
* history/HistoryItem.cpp:
(WebCore::HistoryItem::encodeBackForwardTree): Use references instead of pointers.
(WebCore::HistoryItem::encodeBackForwardTreeNode): Ditto.
(WebCore::HistoryItem::decodeBackForwardTree): Ditto.
* history/HistoryItem.h: Ditto.
* platform/network/FormData.cpp:
(WebCore::encode): Ditto.
(WebCore::decode): Ditto.
(WebCore::FormData::encodeForBackForward): Ditto.
(WebCore::FormData::decodeForBackForward): Ditto.
* platform/network/FormData.h: Ditto.
2011-01-04 Xiaomei Ji <xji@chromium.org> 2011-01-04 Xiaomei Ji <xji@chromium.org>
Reviewed by Dan Bernstein. Reviewed by Dan Bernstein.
......
...@@ -193,6 +193,7 @@ __ZN7WebCore11HistoryItem18recordInitialVisitEv ...@@ -193,6 +193,7 @@ __ZN7WebCore11HistoryItem18recordInitialVisitEv
__ZN7WebCore11HistoryItem18setLastVisitedTimeEd __ZN7WebCore11HistoryItem18setLastVisitedTimeEd
__ZN7WebCore11HistoryItem20setOriginalURLStringERKN3WTF6StringE __ZN7WebCore11HistoryItem20setOriginalURLStringERKN3WTF6StringE
__ZN7WebCore11HistoryItem20setTransientPropertyERKN3WTF6StringEP11objc_object __ZN7WebCore11HistoryItem20setTransientPropertyERKN3WTF6StringEP11objc_object
__ZN7WebCore11HistoryItem21decodeBackForwardTreeERKN3WTF6StringES4_S4_RNS1_7DecoderE
__ZN7WebCore11HistoryItem22mergeAutoCompleteHintsEPS0_ __ZN7WebCore11HistoryItem22mergeAutoCompleteHintsEPS0_
__ZN7WebCore11HistoryItem6setURLERKNS_4KURLE __ZN7WebCore11HistoryItem6setURLERKNS_4KURLE
__ZN7WebCore11HistoryItem7visitedERKN3WTF6StringEdNS_18VisitCountBehaviorE __ZN7WebCore11HistoryItem7visitedERKN3WTF6StringEdNS_18VisitCountBehaviorE
...@@ -340,8 +341,8 @@ __ZN7WebCore14SecurityOrigin28createFromDatabaseIdentifierERKN3WTF6StringE ...@@ -340,8 +341,8 @@ __ZN7WebCore14SecurityOrigin28createFromDatabaseIdentifierERKN3WTF6StringE
__ZN7WebCore14SecurityOrigin29addOriginAccessWhitelistEntryERKS0_RKN3WTF6StringES6_b __ZN7WebCore14SecurityOrigin29addOriginAccessWhitelistEntryERKS0_RKN3WTF6StringES6_b
__ZN7WebCore14SecurityOrigin32removeOriginAccessWhitelistEntryERKS0_RKN3WTF6StringES6_b __ZN7WebCore14SecurityOrigin32removeOriginAccessWhitelistEntryERKS0_RKN3WTF6StringES6_b
__ZN7WebCore14SecurityOrigin40setDomainRelaxationForbiddenForURLSchemeEbRKN3WTF6StringE __ZN7WebCore14SecurityOrigin40setDomainRelaxationForbiddenForURLSchemeEbRKN3WTF6StringE
__ZN7WebCore14SecurityOrigin6createERKNS_4KURLEi
__ZN7WebCore14SecurityOrigin6createERKN3WTF6StringES4_i __ZN7WebCore14SecurityOrigin6createERKN3WTF6StringES4_i
__ZN7WebCore14SecurityOrigin6createERKNS_4KURLEi
__ZN7WebCore15ArchiveResource6createEN3WTF10PassRefPtrINS_12SharedBufferEEERKNS_4KURLERKNS1_6StringESA_SA_RKNS_16ResourceResponseE __ZN7WebCore15ArchiveResource6createEN3WTF10PassRefPtrINS_12SharedBufferEEERKNS_4KURLERKNS1_6StringESA_SA_RKNS_16ResourceResponseE
__ZN7WebCore15DOMWrapperWorld15unregisterWorldEv __ZN7WebCore15DOMWrapperWorld15unregisterWorldEv
__ZN7WebCore15DOMWrapperWorldD1Ev __ZN7WebCore15DOMWrapperWorldD1Ev
...@@ -966,6 +967,7 @@ __ZNK7WebCore11HistoryItem14alternateTitleEv ...@@ -966,6 +967,7 @@ __ZNK7WebCore11HistoryItem14alternateTitleEv
__ZNK7WebCore11HistoryItem15lastVisitedTimeEv __ZNK7WebCore11HistoryItem15lastVisitedTimeEv
__ZNK7WebCore11HistoryItem17originalURLStringEv __ZNK7WebCore11HistoryItem17originalURLStringEv
__ZNK7WebCore11HistoryItem20getTransientPropertyERKN3WTF6StringE __ZNK7WebCore11HistoryItem20getTransientPropertyERKN3WTF6StringE
__ZNK7WebCore11HistoryItem21encodeBackForwardTreeERN3WTF7EncoderE
__ZNK7WebCore11HistoryItem3urlEv __ZNK7WebCore11HistoryItem3urlEv
__ZNK7WebCore11HistoryItem4copyEv __ZNK7WebCore11HistoryItem4copyEv
__ZNK7WebCore11HistoryItem4iconEv __ZNK7WebCore11HistoryItem4iconEv
......
...@@ -625,59 +625,59 @@ void HistoryItem::setRedirectURLs(PassOwnPtr<Vector<String> > redirectURLs) ...@@ -625,59 +625,59 @@ void HistoryItem::setRedirectURLs(PassOwnPtr<Vector<String> > redirectURLs)
m_redirectURLs = redirectURLs; m_redirectURLs = redirectURLs;
} }
void HistoryItem::encodeBackForwardTree(Encoder* encoder) const void HistoryItem::encodeBackForwardTree(Encoder& encoder) const
{ {
encoder->encodeUInt32(backForwardTreeEncodingVersion); encoder.encodeUInt32(backForwardTreeEncodingVersion);
encodeBackForwardTreeNode(encoder); encodeBackForwardTreeNode(encoder);
} }
void HistoryItem::encodeBackForwardTreeNode(Encoder* encoder) const void HistoryItem::encodeBackForwardTreeNode(Encoder& encoder) const
{ {
size_t size = m_children.size(); size_t size = m_children.size();
encoder->encodeUInt64(size); encoder.encodeUInt64(size);
for (size_t i = 0; i < size; ++i) { for (size_t i = 0; i < size; ++i) {
const HistoryItem& child = *m_children[i]; const HistoryItem& child = *m_children[i];
encoder->encodeString(child.m_originalURLString); encoder.encodeString(child.m_originalURLString);
encoder->encodeString(child.m_urlString); encoder.encodeString(child.m_urlString);
child.encodeBackForwardTreeNode(encoder); child.encodeBackForwardTreeNode(encoder);
} }
encoder->encodeInt64(m_documentSequenceNumber); encoder.encodeInt64(m_documentSequenceNumber);
size = m_documentState.size(); size = m_documentState.size();
encoder->encodeUInt64(size); encoder.encodeUInt64(size);
for (size_t i = 0; i < size; ++i) for (size_t i = 0; i < size; ++i)
encoder->encodeString(m_documentState[i]); encoder.encodeString(m_documentState[i]);
encoder->encodeString(m_formContentType); encoder.encodeString(m_formContentType);
encoder->encodeBool(m_formData); encoder.encodeBool(m_formData);
if (m_formData) if (m_formData)
m_formData->encodeForBackForward(encoder); m_formData->encodeForBackForward(encoder);
encoder->encodeInt64(m_itemSequenceNumber); encoder.encodeInt64(m_itemSequenceNumber);
encoder->encodeString(m_originalURLString); encoder.encodeString(m_originalURLString);
encoder->encodeString(m_referrer); encoder.encodeString(m_referrer);
encoder->encodeInt32(m_scrollPoint.x()); encoder.encodeInt32(m_scrollPoint.x());
encoder->encodeInt32(m_scrollPoint.y()); encoder.encodeInt32(m_scrollPoint.y());
encoder->encodeBool(m_stateObject); encoder.encodeBool(m_stateObject);
if (m_stateObject) { if (m_stateObject) {
#if !USE(V8) #if !USE(V8)
encoder->encodeBytes(m_stateObject->data().data(), m_stateObject->data().size()); encoder.encodeBytes(m_stateObject->data().data(), m_stateObject->data().size());
#else #else
encoder->encodeString(m_stateObject->toWireString()); encoder.encodeString(m_stateObject->toWireString());
#endif #endif
} }
encoder->encodeString(m_target); encoder.encodeString(m_target);
} }
struct DecodeRecursionStackElement { struct DecodeRecursionStackElement {
...@@ -693,13 +693,13 @@ struct DecodeRecursionStackElement { ...@@ -693,13 +693,13 @@ struct DecodeRecursionStackElement {
} }
}; };
PassRefPtr<HistoryItem> HistoryItem::decodeBackForwardTree(const String& topURLString, const String& topTitle, const String& topOriginalURLString, Decoder* decoder) PassRefPtr<HistoryItem> HistoryItem::decodeBackForwardTree(const String& topURLString, const String& topTitle, const String& topOriginalURLString, Decoder& decoder)
{ {
// Since the data stream is not trusted, the decode has to be non-recursive. // Since the data stream is not trusted, the decode has to be non-recursive.
// We don't want bad data to cause a stack overflow. // We don't want bad data to cause a stack overflow.
uint32_t version; uint32_t version;
if (!decoder->decodeUInt32(version)) if (!decoder.decodeUInt32(version))
return 0; return 0;
if (version != backForwardTreeEncodingVersion) if (version != backForwardTreeEncodingVersion)
return 0; return 0;
...@@ -718,15 +718,15 @@ recurse: ...@@ -718,15 +718,15 @@ recurse:
title = String(); title = String();
uint64_t size; uint64_t size;
if (!decoder->decodeUInt64(size)) if (!decoder.decodeUInt64(size))
return 0; return 0;
size_t i; size_t i;
RefPtr<HistoryItem> child; RefPtr<HistoryItem> child;
for (i = 0; i < size; ++i) { for (i = 0; i < size; ++i) {
if (!decoder->decodeString(originalURLString)) if (!decoder.decodeString(originalURLString))
return 0; return 0;
if (!decoder->decodeString(urlString)) if (!decoder.decodeString(urlString))
return 0; return 0;
recursionStack.append(DecodeRecursionStackElement(node.release(), i, size)); recursionStack.append(DecodeRecursionStackElement(node.release(), i, size));
...@@ -736,23 +736,23 @@ resume: ...@@ -736,23 +736,23 @@ resume:
node->m_children.append(child.release()); node->m_children.append(child.release());
} }
if (!decoder->decodeInt64(node->m_documentSequenceNumber)) if (!decoder.decodeInt64(node->m_documentSequenceNumber))
return 0; return 0;
if (!decoder->decodeUInt64(size)) if (!decoder.decodeUInt64(size))
return 0; return 0;
for (i = 0; i < size; ++i) { for (i = 0; i < size; ++i) {
String state; String state;
if (!decoder->decodeString(state)) if (!decoder.decodeString(state))
return 0; return 0;
node->m_documentState.append(state); node->m_documentState.append(state);
} }
if (!decoder->decodeString(node->m_formContentType)) if (!decoder.decodeString(node->m_formContentType))
return 0; return 0;
bool hasFormData; bool hasFormData;
if (!decoder->decodeBool(hasFormData)) if (!decoder.decodeBool(hasFormData))
return 0; return 0;
if (hasFormData) { if (hasFormData) {
node->m_formData = FormData::decodeForBackForward(decoder); node->m_formData = FormData::decodeForBackForward(decoder);
...@@ -760,41 +760,41 @@ resume: ...@@ -760,41 +760,41 @@ resume:
return 0; return 0;
} }
if (!decoder->decodeInt64(node->m_itemSequenceNumber)) if (!decoder.decodeInt64(node->m_itemSequenceNumber))
return 0; return 0;
if (!decoder->decodeString(node->m_originalURLString)) if (!decoder.decodeString(node->m_originalURLString))
return 0; return 0;
if (!decoder->decodeString(node->m_referrer)) if (!decoder.decodeString(node->m_referrer))
return 0; return 0;
int32_t x; int32_t x;
if (!decoder->decodeInt32(x)) if (!decoder.decodeInt32(x))
return 0; return 0;
int32_t y; int32_t y;
if (!decoder->decodeInt32(y)) if (!decoder.decodeInt32(y))
return 0; return 0;
node->m_scrollPoint = IntPoint(x, y); node->m_scrollPoint = IntPoint(x, y);
bool hasStateObject; bool hasStateObject;
if (!decoder->decodeBool(hasStateObject)) if (!decoder.decodeBool(hasStateObject))
return 0; return 0;
if (hasStateObject) { if (hasStateObject) {
#if !USE(V8) #if !USE(V8)
Vector<uint8_t> bytes; Vector<uint8_t> bytes;
if (!decoder->decodeBytes(bytes)) if (!decoder.decodeBytes(bytes))
return 0; return 0;
node->m_stateObject = SerializedScriptValue::adopt(bytes); node->m_stateObject = SerializedScriptValue::adopt(bytes);
#else #else
String string; String string;
if (!decoder->decodeString(string)) if (!decoder.decodeString(string))
return 0; return 0;
node->m_stateObject = SerializedScriptValue::createFromWire(string); node->m_stateObject = SerializedScriptValue::createFromWire(string);
#endif #endif
} }
if (!decoder->decodeString(node->m_target)) if (!decoder.decodeString(node->m_target))
return 0; return 0;
// Simulate recursion with our own stack. // Simulate recursion with our own stack.
......
...@@ -88,8 +88,8 @@ public: ...@@ -88,8 +88,8 @@ public:
PassRefPtr<HistoryItem> copy() const; PassRefPtr<HistoryItem> copy() const;
void encodeBackForwardTree(Encoder*) const; void encodeBackForwardTree(Encoder&) const;
static PassRefPtr<HistoryItem> decodeBackForwardTree(const String& urlString, const String& title, const String& originalURLString, Decoder*); static PassRefPtr<HistoryItem> decodeBackForwardTree(const String& urlString, const String& title, const String& originalURLString, Decoder&);
const String& originalURLString() const; const String& originalURLString() const;
const String& urlString() const; const String& urlString() const;
...@@ -226,8 +226,8 @@ private: ...@@ -226,8 +226,8 @@ private:
HistoryItem* findTargetItem(); HistoryItem* findTargetItem();
void encodeBackForwardTreeNode(Encoder*) const; void encodeBackForwardTreeNode(Encoder&) const;
static PassRefPtr<HistoryItem> decodeBackForwardTreeNode(const String& urlString, const String& title, const String& originalURLString, Decoder*); static PassRefPtr<HistoryItem> decodeBackForwardTreeNode(const String& urlString, const String& title, const String& originalURLString, Decoder&);
/* When adding new member variables to this class, please notify the Qt team. /* When adding new member variables to this class, please notify the Qt team.
* qt/HistoryItemQt.cpp contains code to serialize history items. * qt/HistoryItemQt.cpp contains code to serialize history items.
......
...@@ -329,32 +329,32 @@ void FormData::removeGeneratedFilesIfNeeded() ...@@ -329,32 +329,32 @@ void FormData::removeGeneratedFilesIfNeeded()
m_hasGeneratedFiles = false; m_hasGeneratedFiles = false;
} }
static void encode(Encoder* encoder, const FormDataElement& element) static void encode(Encoder& encoder, const FormDataElement& element)
{ {
encoder->encodeUInt32(element.m_type); encoder.encodeUInt32(element.m_type);
switch (element.m_type) { switch (element.m_type) {
case FormDataElement::data: case FormDataElement::data:
encoder->encodeBytes(reinterpret_cast<const uint8_t*>(element.m_data.data()), element.m_data.size()); encoder.encodeBytes(reinterpret_cast<const uint8_t*>(element.m_data.data()), element.m_data.size());
return; return;
case FormDataElement::encodedFile: case FormDataElement::encodedFile:
encoder->encodeString(element.m_filename); encoder.encodeString(element.m_filename);
encoder->encodeBool(element.m_shouldGenerateFile); encoder.encodeBool(element.m_shouldGenerateFile);
#if ENABLE(BLOB) #if ENABLE(BLOB)
encoder->encodeInt64(element.m_fileStart); encoder.encodeInt64(element.m_fileStart);
encoder->encodeInt64(element.m_fileLength); encoder.encodeInt64(element.m_fileLength);
encoder->encodeDouble(element.m_expectedFileModificationTime); encoder.encodeDouble(element.m_expectedFileModificationTime);
#else #else
encoder->encodeInt64(0); encoder.encodeInt64(0);
encoder->encodeInt64(0); encoder.encodeInt64(0);
encoder->encodeDouble(0); encoder.encodeDouble(0);
#endif #endif
return; return;
#if ENABLE(BLOB) #if ENABLE(BLOB)
case FormDataElement::encodedBlob: case FormDataElement::encodedBlob:
encoder->encodeString(element.m_blobURL.string()); encoder.encodeString(element.m_blobURL.string());
return; return;
#endif #endif
} }
...@@ -362,7 +362,7 @@ static void encode(Encoder* encoder, const FormDataElement& element) ...@@ -362,7 +362,7 @@ static void encode(Encoder* encoder, const FormDataElement& element)
ASSERT_NOT_REACHED(); ASSERT_NOT_REACHED();
} }
static bool decode(Decoder* decoder, FormDataElement& element) static bool decode(Decoder& decoder, FormDataElement& element)
{ {
uint32_t type = element.m_type; uint32_t type = element.m_type;
...@@ -370,7 +370,7 @@ static bool decode(Decoder* decoder, FormDataElement& element) ...@@ -370,7 +370,7 @@ static bool decode(Decoder* decoder, FormDataElement& element)
case FormDataElement::data: { case FormDataElement::data: {
element.m_type = FormDataElement::data; element.m_type = FormDataElement::data;
Vector<uint8_t> data; Vector<uint8_t> data;
if (!decoder->decodeBytes(data)) if (!decoder.decodeBytes(data))
return false; return false;
size_t size = data.size(); size_t size = data.size();
element.m_data.resize(size); element.m_data.resize(size);
...@@ -380,22 +380,22 @@ static bool decode(Decoder* decoder, FormDataElement& element) ...@@ -380,22 +380,22 @@ static bool decode(Decoder* decoder, FormDataElement& element)
case FormDataElement::encodedFile: { case FormDataElement::encodedFile: {
element.m_type = FormDataElement::encodedFile; element.m_type = FormDataElement::encodedFile;
if (!decoder->decodeString(element.m_filename)) if (!decoder.decodeString(element.m_filename))
return false; return false;
if (!decoder->decodeBool(element.m_shouldGenerateFile)) if (!decoder.decodeBool(element.m_shouldGenerateFile))
return false; return false;
int64_t fileStart; int64_t fileStart;
if (!decoder->decodeInt64(fileStart)) if (!decoder.decodeInt64(fileStart))
return false; return false;
if (fileStart < 0) if (fileStart < 0)
return false; return false;
int64_t fileLength; int64_t fileLength;
if (!decoder->decodeInt64(fileLength)) if (!decoder.decodeInt64(fileLength))
return false; return false;
if (fileLength < fileStart) if (fileLength < fileStart)
return false; return false;
double expectedFileModificationTime; double expectedFileModificationTime;
if (!decoder->decodeDouble(expectedFileModificationTime)) if (!decoder.decodeDouble(expectedFileModificationTime))
return false; return false;
#if ENABLE(BLOB) #if ENABLE(BLOB)
element.m_fileStart = fileStart; element.m_fileStart = fileStart;
...@@ -409,7 +409,7 @@ static bool decode(Decoder* decoder, FormDataElement& element) ...@@ -409,7 +409,7 @@ static bool decode(Decoder* decoder, FormDataElement& element)
case FormDataElement::encodedBlob: case FormDataElement::encodedBlob:
element.m_type = FormDataElement::encodedBlob; element.m_type = FormDataElement::encodedBlob;
String blobURLString; String blobURLString;
if (!decoder->decodeString(blobURLString)) if (!decoder.decodeString(blobURLString))
return false; return false;
element.m_blobURL = KURL(KURL(), blobURLString); element.m_blobURL = KURL(KURL(), blobURLString);
return true; return true;
...@@ -419,38 +419,38 @@ static bool decode(Decoder* decoder, FormDataElement& element) ...@@ -419,38 +419,38 @@ static bool decode(Decoder* decoder, FormDataElement& element)
return false; return false;
} }
void FormData::encodeForBackForward(Encoder* encoder) const void FormData::encodeForBackForward(Encoder& encoder) const
{ {
encoder->encodeBool(m_alwaysStream); encoder.encodeBool(m_alwaysStream);
encoder->encodeBytes(reinterpret_cast<const uint8_t*>(m_boundary.data()), m_boundary.size()); encoder.encodeBytes(reinterpret_cast<const uint8_t*>(m_boundary.data()), m_boundary.size());
size_t size = m_elements.size(); size_t size = m_elements.size();
encoder->encodeUInt64(size); encoder.encodeUInt64(size);
for (size_t i = 0; i < size; ++i) for (size_t i = 0; i < size; ++i)
encode(encoder, m_elements[i]); encode(encoder, m_elements[i]);
encoder->encodeBool(m_hasGeneratedFiles); encoder.encodeBool(m_hasGeneratedFiles);
encoder->encodeBool(m_identifier); encoder.encodeBool(m_identifier);
} }
PassRefPtr<FormData> FormData::decodeForBackForward(Decoder* decoder) PassRefPtr<FormData> FormData::decodeForBackForward(Decoder& decoder)
{ {
RefPtr<FormData> data = FormData::create(); RefPtr<FormData> data = FormData::create();
if (!decoder->decodeBool(data->m_alwaysStream)) if (!decoder.decodeBool(data->m_alwaysStream))
return 0; return 0;
Vector<uint8_t> boundary; Vector<uint8_t> boundary;
if (!decoder->decodeBytes(boundary)) if (!decoder.decodeBytes(boundary))
return 0; return 0;
size_t size = boundary.size(); size_t size = boundary.size();
data->m_boundary.resize(size); data->m_boundary.resize(size);
memcpy(data->m_boundary.data(), boundary.data(), size); memcpy(data->m_boundary.data(), boundary.data(), size);
uint64_t elementsSize; uint64_t elementsSize;
if (!decoder->decodeUInt64(elementsSize)) if (!decoder.decodeUInt64(elementsSize))
return 0; return 0;
for (size_t i = 0; i < elementsSize; ++i) { for (size_t i = 0; i < elementsSize; ++i) {
FormDataElement element; FormDataElement element;
...@@ -459,10 +459,10 @@ PassRefPtr<FormData> FormData::decodeForBackForward(Decoder* decoder) ...@@ -459,10 +459,10 @@ PassRefPtr<FormData> FormData::decodeForBackForward(Decoder* decoder)
data->m_elements.append(element); data->m_elements.append(element);
} }
if (!decoder->decodeBool(data->m_hasGeneratedFiles)) if (!decoder.decodeBool(data->m_hasGeneratedFiles))
return 0; return 0;
if (!decoder->decodeInt64(data->m_identifier)) if (!decoder.decodeInt64(data->m_identifier))
return 0; return 0;
return data.release(); return data.release();
......
...@@ -101,8 +101,8 @@ public: ...@@ -101,8 +101,8 @@ public:
PassRefPtr<FormData> deepCopy() const; PassRefPtr<FormData> deepCopy() const;
~FormData(); ~FormData();
void encodeForBackForward(Encoder*) const; void encodeForBackForward(Encoder&) const;
static PassRefPtr<FormData> decodeForBackForward(Decoder*); static PassRefPtr<FormData> decodeForBackForward(Decoder&);
void appendData(const void* data, size_t); void appendData(const void* data, size_t);
void appendFile(const String& filePath, bool shouldGenerateFile = false); void appendFile(const String& filePath, bool shouldGenerateFile = false);
......
2011-01-04 Darin Adler <darin@apple.com>