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>
Reviewed by Dan Bernstein.
......
......@@ -193,6 +193,7 @@ __ZN7WebCore11HistoryItem18recordInitialVisitEv
__ZN7WebCore11HistoryItem18setLastVisitedTimeEd
__ZN7WebCore11HistoryItem20setOriginalURLStringERKN3WTF6StringE
__ZN7WebCore11HistoryItem20setTransientPropertyERKN3WTF6StringEP11objc_object
__ZN7WebCore11HistoryItem21decodeBackForwardTreeERKN3WTF6StringES4_S4_RNS1_7DecoderE
__ZN7WebCore11HistoryItem22mergeAutoCompleteHintsEPS0_
__ZN7WebCore11HistoryItem6setURLERKNS_4KURLE
__ZN7WebCore11HistoryItem7visitedERKN3WTF6StringEdNS_18VisitCountBehaviorE
......@@ -340,8 +341,8 @@ __ZN7WebCore14SecurityOrigin28createFromDatabaseIdentifierERKN3WTF6StringE
__ZN7WebCore14SecurityOrigin29addOriginAccessWhitelistEntryERKS0_RKN3WTF6StringES6_b
__ZN7WebCore14SecurityOrigin32removeOriginAccessWhitelistEntryERKS0_RKN3WTF6StringES6_b
__ZN7WebCore14SecurityOrigin40setDomainRelaxationForbiddenForURLSchemeEbRKN3WTF6StringE
__ZN7WebCore14SecurityOrigin6createERKNS_4KURLEi
__ZN7WebCore14SecurityOrigin6createERKN3WTF6StringES4_i
__ZN7WebCore14SecurityOrigin6createERKNS_4KURLEi
__ZN7WebCore15ArchiveResource6createEN3WTF10PassRefPtrINS_12SharedBufferEEERKNS_4KURLERKNS1_6StringESA_SA_RKNS_16ResourceResponseE
__ZN7WebCore15DOMWrapperWorld15unregisterWorldEv
__ZN7WebCore15DOMWrapperWorldD1Ev
......@@ -966,6 +967,7 @@ __ZNK7WebCore11HistoryItem14alternateTitleEv
__ZNK7WebCore11HistoryItem15lastVisitedTimeEv
__ZNK7WebCore11HistoryItem17originalURLStringEv
__ZNK7WebCore11HistoryItem20getTransientPropertyERKN3WTF6StringE
__ZNK7WebCore11HistoryItem21encodeBackForwardTreeERN3WTF7EncoderE
__ZNK7WebCore11HistoryItem3urlEv
__ZNK7WebCore11HistoryItem4copyEv
__ZNK7WebCore11HistoryItem4iconEv
......
......@@ -625,59 +625,59 @@ void HistoryItem::setRedirectURLs(PassOwnPtr<Vector<String> > redirectURLs)
m_redirectURLs = redirectURLs;
}
void HistoryItem::encodeBackForwardTree(Encoder* encoder) const
void HistoryItem::encodeBackForwardTree(Encoder& encoder) const
{
encoder->encodeUInt32(backForwardTreeEncodingVersion);
encoder.encodeUInt32(backForwardTreeEncodingVersion);
encodeBackForwardTreeNode(encoder);
}
void HistoryItem::encodeBackForwardTreeNode(Encoder* encoder) const
void HistoryItem::encodeBackForwardTreeNode(Encoder& encoder) const
{
size_t size = m_children.size();
encoder->encodeUInt64(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_originalURLString);
encoder->encodeString(child.m_urlString);
encoder.encodeString(child.m_urlString);
child.encodeBackForwardTreeNode(encoder);
}
encoder->encodeInt64(m_documentSequenceNumber);
encoder.encodeInt64(m_documentSequenceNumber);
size = m_documentState.size();
encoder->encodeUInt64(size);
encoder.encodeUInt64(size);
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)
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.y());
encoder.encodeInt32(m_scrollPoint.x());
encoder.encodeInt32(m_scrollPoint.y());
encoder->encodeBool(m_stateObject);
encoder.encodeBool(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());
encoder.encodeString(m_stateObject->toWireString());
#endif
}
encoder->encodeString(m_target);
encoder.encodeString(m_target);
}
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.
// We don't want bad data to cause a stack overflow.
uint32_t version;
if (!decoder->decodeUInt32(version))
if (!decoder.decodeUInt32(version))
return 0;
if (version != backForwardTreeEncodingVersion)
return 0;
......@@ -718,15 +718,15 @@ recurse:
title = String();
uint64_t size;
if (!decoder->decodeUInt64(size))
if (!decoder.decodeUInt64(size))
return 0;
size_t i;
RefPtr<HistoryItem> child;
for (i = 0; i < size; ++i) {
if (!decoder->decodeString(originalURLString))
if (!decoder.decodeString(originalURLString))
return 0;
if (!decoder->decodeString(urlString))
if (!decoder.decodeString(urlString))
return 0;
recursionStack.append(DecodeRecursionStackElement(node.release(), i, size));
......@@ -736,23 +736,23 @@ resume:
node->m_children.append(child.release());
}
if (!decoder->decodeInt64(node->m_documentSequenceNumber))
if (!decoder.decodeInt64(node->m_documentSequenceNumber))
return 0;
if (!decoder->decodeUInt64(size))
if (!decoder.decodeUInt64(size))
return 0;
for (i = 0; i < size; ++i) {
String state;
if (!decoder->decodeString(state))
if (!decoder.decodeString(state))
return 0;
node->m_documentState.append(state);
}
if (!decoder->decodeString(node->m_formContentType))
if (!decoder.decodeString(node->m_formContentType))
return 0;
bool hasFormData;
if (!decoder->decodeBool(hasFormData))
if (!decoder.decodeBool(hasFormData))
return 0;
if (hasFormData) {
node->m_formData = FormData::decodeForBackForward(decoder);
......@@ -760,41 +760,41 @@ resume:
return 0;
}
if (!decoder->decodeInt64(node->m_itemSequenceNumber))
if (!decoder.decodeInt64(node->m_itemSequenceNumber))
return 0;
if (!decoder->decodeString(node->m_originalURLString))
if (!decoder.decodeString(node->m_originalURLString))
return 0;
if (!decoder->decodeString(node->m_referrer))
if (!decoder.decodeString(node->m_referrer))
return 0;
int32_t x;
if (!decoder->decodeInt32(x))
if (!decoder.decodeInt32(x))
return 0;
int32_t y;
if (!decoder->decodeInt32(y))
if (!decoder.decodeInt32(y))
return 0;
node->m_scrollPoint = IntPoint(x, y);
bool hasStateObject;
if (!decoder->decodeBool(hasStateObject))
if (!decoder.decodeBool(hasStateObject))
return 0;
if (hasStateObject) {
#if !USE(V8)
Vector<uint8_t> bytes;
if (!decoder->decodeBytes(bytes))
if (!decoder.decodeBytes(bytes))
return 0;
node->m_stateObject = SerializedScriptValue::adopt(bytes);
#else
String string;
if (!decoder->decodeString(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))
return 0;
// Simulate recursion with our own stack.
......
......@@ -88,8 +88,8 @@ public:
PassRefPtr<HistoryItem> copy() const;
void encodeBackForwardTree(Encoder*) const;
static PassRefPtr<HistoryItem> decodeBackForwardTree(const String& urlString, const String& title, const String& originalURLString, Decoder*);
void encodeBackForwardTree(Encoder&) const;
static PassRefPtr<HistoryItem> decodeBackForwardTree(const String& urlString, const String& title, const String& originalURLString, Decoder&);
const String& originalURLString() const;
const String& urlString() const;
......@@ -226,8 +226,8 @@ private:
HistoryItem* findTargetItem();
void encodeBackForwardTreeNode(Encoder*) const;
static PassRefPtr<HistoryItem> decodeBackForwardTreeNode(const String& urlString, const String& title, const String& originalURLString, Decoder*);
void encodeBackForwardTreeNode(Encoder&) const;
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.
* qt/HistoryItemQt.cpp contains code to serialize history items.
......
......@@ -329,32 +329,32 @@ void FormData::removeGeneratedFilesIfNeeded()
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) {
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;
case FormDataElement::encodedFile:
encoder->encodeString(element.m_filename);
encoder->encodeBool(element.m_shouldGenerateFile);
encoder.encodeString(element.m_filename);
encoder.encodeBool(element.m_shouldGenerateFile);
#if ENABLE(BLOB)
encoder->encodeInt64(element.m_fileStart);
encoder->encodeInt64(element.m_fileLength);
encoder->encodeDouble(element.m_expectedFileModificationTime);
encoder.encodeInt64(element.m_fileStart);
encoder.encodeInt64(element.m_fileLength);
encoder.encodeDouble(element.m_expectedFileModificationTime);
#else
encoder->encodeInt64(0);
encoder->encodeInt64(0);
encoder->encodeDouble(0);
encoder.encodeInt64(0);
encoder.encodeInt64(0);
encoder.encodeDouble(0);
#endif
return;
#if ENABLE(BLOB)
case FormDataElement::encodedBlob:
encoder->encodeString(element.m_blobURL.string());
encoder.encodeString(element.m_blobURL.string());
return;
#endif
}
......@@ -362,7 +362,7 @@ static void encode(Encoder* encoder, const FormDataElement& element)
ASSERT_NOT_REACHED();
}
static bool decode(Decoder* decoder, FormDataElement& element)
static bool decode(Decoder& decoder, FormDataElement& element)
{
uint32_t type = element.m_type;
......@@ -370,7 +370,7 @@ static bool decode(Decoder* decoder, FormDataElement& element)
case FormDataElement::data: {
element.m_type = FormDataElement::data;
Vector<uint8_t> data;
if (!decoder->decodeBytes(data))
if (!decoder.decodeBytes(data))
return false;
size_t size = data.size();
element.m_data.resize(size);
......@@ -380,22 +380,22 @@ static bool decode(Decoder* decoder, FormDataElement& element)
case FormDataElement::encodedFile: {
element.m_type = FormDataElement::encodedFile;
if (!decoder->decodeString(element.m_filename))
if (!decoder.decodeString(element.m_filename))
return false;
if (!decoder->decodeBool(element.m_shouldGenerateFile))
if (!decoder.decodeBool(element.m_shouldGenerateFile))
return false;
int64_t fileStart;
if (!decoder->decodeInt64(fileStart))
if (!decoder.decodeInt64(fileStart))
return false;
if (fileStart < 0)
return false;
int64_t fileLength;
if (!decoder->decodeInt64(fileLength))
if (!decoder.decodeInt64(fileLength))
return false;
if (fileLength < fileStart)
return false;
double expectedFileModificationTime;
if (!decoder->decodeDouble(expectedFileModificationTime))
if (!decoder.decodeDouble(expectedFileModificationTime))
return false;
#if ENABLE(BLOB)
element.m_fileStart = fileStart;
......@@ -409,7 +409,7 @@ static bool decode(Decoder* decoder, FormDataElement& element)
case FormDataElement::encodedBlob:
element.m_type = FormDataElement::encodedBlob;
String blobURLString;
if (!decoder->decodeString(blobURLString))
if (!decoder.decodeString(blobURLString))
return false;
element.m_blobURL = KURL(KURL(), blobURLString);
return true;
......@@ -419,38 +419,38 @@ static bool decode(Decoder* decoder, FormDataElement& element)
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();
encoder->encodeUInt64(size);
encoder.encodeUInt64(size);
for (size_t i = 0; i < size; ++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();
if (!decoder->decodeBool(data->m_alwaysStream))
if (!decoder.decodeBool(data->m_alwaysStream))
return 0;
Vector<uint8_t> boundary;
if (!decoder->decodeBytes(boundary))
if (!decoder.decodeBytes(boundary))
return 0;
size_t size = boundary.size();
data->m_boundary.resize(size);
memcpy(data->m_boundary.data(), boundary.data(), size);
uint64_t elementsSize;
if (!decoder->decodeUInt64(elementsSize))
if (!decoder.decodeUInt64(elementsSize))
return 0;
for (size_t i = 0; i < elementsSize; ++i) {
FormDataElement element;
......@@ -459,10 +459,10 @@ PassRefPtr<FormData> FormData::decodeForBackForward(Decoder* decoder)
data->m_elements.append(element);
}
if (!decoder->decodeBool(data->m_hasGeneratedFiles))
if (!decoder.decodeBool(data->m_hasGeneratedFiles))
return 0;
if (!decoder->decodeInt64(data->m_identifier))
if (!decoder.decodeInt64(data->m_identifier))
return 0;
return data.release();
......
......@@ -101,8 +101,8 @@ public:
PassRefPtr<FormData> deepCopy() const;
~FormData();
void encodeForBackForward(Encoder*) const;
static PassRefPtr<FormData> decodeForBackForward(Decoder*);
void encodeForBackForward(Encoder&) const;
static PassRefPtr<FormData> decodeForBackForward(Decoder&);
void appendData(const void* data, size_t);
void appendFile(const String& filePath, bool shouldGenerateFile = false);
......
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.
2011-01-04 Anders Carlsson <andersca@apple.com>
Reviewed by Sam Weinig.
......@@ -400,8 +400,12 @@ libWebKit2_la_SOURCES = \
WebKit2/WebProcess/WebKitMain.cpp \
WebKit2/WebProcess/WebPage/ChunkedUpdateDrawingArea.cpp \
WebKit2/WebProcess/WebPage/ChunkedUpdateDrawingArea.h \
WebKit2/WebProcess/WebPage/DecoderAdapter.cpp \
WebKit2/WebProcess/WebPage/DecoderAdapter.h \
WebKit2/WebProcess/WebPage/DrawingArea.cpp \
WebKit2/WebProcess/WebPage/DrawingArea.h \
WebKit2/WebProcess/WebPage/EncoderAdapter.cpp \
WebKit2/WebProcess/WebPage/EncoderAdapter.h \
WebKit2/WebProcess/WebPage/FindController.cpp \
WebKit2/WebProcess/WebPage/FindController.h \
WebKit2/WebProcess/WebPage/FindPageOverlay.cpp \
......
......@@ -632,7 +632,9 @@ SOURCES += \
WebProcess/WebCoreSupport/qt/WebFrameNetworkingContext.cpp \
WebProcess/WebCoreSupport/qt/WebPopupMenuQt.cpp \
WebProcess/WebPage/ChunkedUpdateDrawingArea.cpp \
WebProcess/WebPage/DecoderAdapter.cpp \
WebProcess/WebPage/DrawingArea.cpp \
WebProcess/WebPage/EncoderAdapter.cpp \
WebProcess/WebPage/FindController.cpp \
WebProcess/WebPage/PageOverlay.cpp \
WebProcess/WebPage/TiledDrawingArea.cpp \
......
......@@ -272,6 +272,10 @@
935EEBA4127761D6003322B8 /* InjectedBundleBackForwardListItem.h in Headers */ = {isa = PBXBuildFile; fileRef = 935EEB921277615D003322B8 /* InjectedBundleBackForwardListItem.h */; };
9391F2CA121B679A00EBF7E8 /* WebFrameNetworkingContext.mm in Sources */ = {isa = PBXBuildFile; fileRef = 9391F284121B38F500EBF7E8 /* WebFrameNetworkingContext.mm */; };
9391F2CB121B67AD00EBF7E8 /* WebFrameNetworkingContext.h in Headers */ = {isa = PBXBuildFile; fileRef = 9391F283121B38F500EBF7E8 /* WebFrameNetworkingContext.h */; };
93FC67BD12D3CCF200A60610 /* DecoderAdapter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93FC679D12D3CC7400A60610 /* DecoderAdapter.cpp */; };
93FC67BE12D3CCF200A60610 /* DecoderAdapter.h in Headers */ = {isa = PBXBuildFile; fileRef = 93FC679E12D3CC7400A60610 /* DecoderAdapter.h */; };
93FC67BF12D3CCF200A60610 /* EncoderAdapter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93FC679F12D3CC7400A60610 /* EncoderAdapter.cpp */; };
93FC67C012D3CCF200A60610 /* EncoderAdapter.h in Headers */ = {isa = PBXBuildFile; fileRef = 93FC67A012D3CC7400A60610 /* EncoderAdapter.h */; };
BC0092F7115837A300E0AE2A /* RunLoopMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = BC0092F5115837A300E0AE2A /* RunLoopMac.mm */; };
BC0092F8115837A300E0AE2A /* WorkQueueMac.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC0092F6115837A300E0AE2A /* WorkQueueMac.cpp */; };
BC032D7510F4378D0058C15A /* WebChromeClient.h in Headers */ = {isa = PBXBuildFile; fileRef = BC032D6010F4378D0058C15A /* WebChromeClient.h */; };
......@@ -949,6 +953,10 @@
935EEB981277616D003322B8 /* WKBundleBackForwardListItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKBundleBackForwardListItem.h; sourceTree = "<group>"; };
9391F283121B38F500EBF7E8 /* WebFrameNetworkingContext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebFrameNetworkingContext.h; sourceTree = "<group>"; };
9391F284121B38F500EBF7E8 /* WebFrameNetworkingContext.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebFrameNetworkingContext.mm; sourceTree = "<group>"; };
93FC679D12D3CC7400A60610 /* DecoderAdapter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DecoderAdapter.cpp; sourceTree = "<group>"; };
93FC679E12D3CC7400A60610 /* DecoderAdapter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DecoderAdapter.h; sourceTree = "<group>"; };
93FC679F12D3CC7400A60610 /* EncoderAdapter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = EncoderAdapter.cpp; sourceTree = "<group>"; };
93FC67A012D3CC7400A60610 /* EncoderAdapter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EncoderAdapter.h; sourceTree = "<group>"; };
A72D5D7F1236CBA800A88B15 /* WebSerializedScriptValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebSerializedScriptValue.h; sourceTree = "<group>"; };
BC0092F5115837A300E0AE2A /* RunLoopMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = RunLoopMac.mm; sourceTree = "<group>"; };
BC0092F6115837A300E0AE2A /* WorkQueueMac.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WorkQueueMac.cpp; sourceTree = "<group>"; };
......@@ -1885,8 +1893,12 @@
BC963D6C113DD19500574BE2 /* mac */,
BC5F7BB21182376C0052C02C /* ChunkedUpdateDrawingArea.cpp */,
BC5F7BB31182376C0052C02C /* ChunkedUpdateDrawingArea.h */,
93FC679D12D3CC7400A60610 /* DecoderAdapter.cpp */,
93FC679E12D3CC7400A60610 /* DecoderAdapter.h */,
BC8452A51162C80900CAB9B5 /* DrawingArea.cpp */,
BC8452A61162C80900CAB9B5 /* DrawingArea.h */,
93FC679F12D3CC7400A60610 /* EncoderAdapter.cpp */,
93FC67A012D3CC7400A60610 /* EncoderAdapter.h */,
1A90C1F31264FD71003E44D4 /* FindController.cpp */,
1A90C1F21264FD71003E44D4 /* FindController.h */,
0F5265B111DD37680006D33C /* LayerBackedDrawingArea.cpp */,
......@@ -2824,6 +2836,8 @@
BCCF6ACA12C91F59008F9C35 /* WKImageCG.h in Headers */,
BCAC111F12C92C1F00B08EEE /* WebDatabaseManagerProxyClient.h in Headers */,
BCCF6B2512C93E7A008F9C35 /* ImageOptions.h in Headers */,
93FC67BE12D3CCF200A60610 /* DecoderAdapter.h in Headers */,
93FC67C012D3CCF200A60610 /* EncoderAdapter.h in Headers */,
1A5E4DA412D3BD3D0099A2BB /* TextCheckerState.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
......@@ -3254,6 +3268,8 @@
BCCF6AC212C91F34008F9C35 /* WKImage.cpp in Sources */,
BCCF6AC912C91F59008F9C35 /* WKImageCG.cpp in Sources */,
BCAC112012C92C1F00B08EEE /* WebDatabaseManagerProxyClient.cpp in Sources */,
93FC67BD12D3CCF200A60610 /* DecoderAdapter.cpp in Sources */,
93FC67BF12D3CCF200A60610 /* EncoderAdapter.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
......
/*
* Copyright (C) 2011 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "DecoderAdapter.h"
#include "WebCoreArgumentCoders.h"
namespace WebKit {
DecoderAdapter::DecoderAdapter(const uint8_t* buffer, size_t bufferSize)
: m_decoder(buffer, bufferSize)
{
}
bool DecoderAdapter::decodeBytes(Vector<uint8_t>& bytes)
{
return m_decoder.decodeBytes(bytes);
}
bool DecoderAdapter::decodeBool(bool& value)
{
return m_decoder.decodeBool(value);
}
bool DecoderAdapter::decodeUInt32(uint32_t& value)
{
return m_decoder.decodeUInt32(value);
}
bool DecoderAdapter::decodeUInt64(uint64_t& value)
{
return m_decoder.decodeUInt64(value);
}
bool DecoderAdapter::decodeInt32(int32_t& value)
{
return m_decoder.decodeInt32(value);
}
bool DecoderAdapter::decodeInt64(int64_t& value)
{
return m_decoder.decodeInt64(value);
}
bool DecoderAdapter::decodeFloat(float& value)
{
return m_decoder.decodeFloat(value);
}
bool DecoderAdapter::decodeDouble(double& value)
{
return m_decoder.decodeDouble(value);
}