Changeset 89177 in webkit
- Timestamp:
- Jun 17, 2011 3:43:17 PM (13 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r89170 r89177 1 2011-06-17 Anders Carlsson <andersca@apple.com> 2 3 Reviewed by Sam Weinig. 4 5 Remove unused ArgumentEncoder and ArgumentDecoder functions 6 https://bugs.webkit.org/show_bug.cgi?id=62909 7 8 * Platform/CoreIPC/ArgumentDecoder.cpp: 9 * Platform/CoreIPC/ArgumentDecoder.h: 10 * Platform/CoreIPC/ArgumentEncoder.cpp: 11 * Platform/CoreIPC/ArgumentEncoder.h: 12 13 * Shared/win/PlatformCertificateInfo.cpp: 14 (WebKit::PlatformCertificateInfo::encode): 15 (WebKit::PlatformCertificateInfo::decode): 16 Replace calls to encodeBytes/decodeBytes with 17 encodeVariableLengthByteArray/decodeVariableLengthByteArray. 18 1 19 2011-06-17 Anders Carlsson <andersca@apple.com> 2 20 -
trunk/Source/WebKit2/Platform/CoreIPC/ArgumentDecoder.cpp
r88886 r89177 116 116 } 117 117 118 bool ArgumentDecoder::decode Bytes(Vector<uint8_t>& buffer)118 bool ArgumentDecoder::decodeVariableLengthByteArray(DataReference& dataReference) 119 119 { 120 120 uint64_t size; 121 121 if (!decodeUInt64(size)) 122 122 return false; 123 124 if (!alignBufferPosition(1, size))125 return false;126 127 buffer.resize(size);128 if (size > 0)129 memcpy(&buffer[0], m_bufferPos, size);130 m_bufferPos += size;131 return true;132 }133 134 bool ArgumentDecoder::decodeVariableLengthByteArray(DataReference& dataReference)135 {136 uint64_t size;137 if (!decodeUInt64(size))138 return false;139 123 140 124 if (!alignBufferPosition(1, size)) … … 145 129 146 130 dataReference = DataReference(data, size); 147 return true;148 }149 150 bool ArgumentDecoder::decodeBytes(uint8_t* buffer, size_t bufferSize)151 {152 // FIXME: Decoding the size is not strictly necessary here since we know the size upfront.153 uint64_t size;154 if (!decodeUInt64(size))155 return false;156 157 ASSERT(size == bufferSize);158 if (size != bufferSize)159 return false;160 161 if (!alignBufferPosition(1, size))162 return false;163 164 memcpy(buffer, m_bufferPos, size);165 m_bufferPos += size;166 131 return true; 167 132 } -
trunk/Source/WebKit2/Platform/CoreIPC/ArgumentDecoder.h
r88869 r89177 52 52 // The data in the data reference here will only be valid for the lifetime of the ArgumentDecoder object. 53 53 bool decodeVariableLengthByteArray(DataReference&); 54 55 bool decodeBytes(Vector<uint8_t>&);56 bool decodeBytes(uint8_t*, size_t);57 54 58 55 bool decodeBool(bool&); -
trunk/Source/WebKit2/Platform/CoreIPC/ArgumentEncoder.cpp
r88869 r89177 103 103 } 104 104 105 void ArgumentEncoder::encodeBytes(const uint8_t* bytes, size_t size)106 {107 // Encode the size.108 encodeUInt64(static_cast<uint64_t>(size));109 110 uint8_t* buffer = grow(1, size);111 112 memcpy(buffer, bytes, size);113 }114 115 105 void ArgumentEncoder::encodeBool(bool n) 116 106 { -
trunk/Source/WebKit2/Platform/CoreIPC/ArgumentEncoder.h
r88869 r89177 45 45 void encodeFixedLengthData(const uint8_t*, size_t, unsigned alignment); 46 46 void encodeVariableLengthByteArray(const DataReference&); 47 48 void encodeBytes(const uint8_t*, size_t);49 47 50 48 void encodeBool(bool); -
trunk/Source/WebKit2/Shared/win/PlatformCertificateInfo.cpp
r84101 r89177 29 29 #include "ArgumentDecoder.h" 30 30 #include "ArgumentEncoder.h" 31 #include "DataReference.h" 31 32 #include <WebCore/ResourceResponse.h> 32 33 … … 118 119 119 120 for (size_t i = 0; i < length; ++i) 120 encoder->encode Bytes(static_cast<uint8_t*>(m_certificateChain[i]->pbCertEncoded), m_certificateChain[i]->cbCertEncoded);121 encoder->encodeVariableLengthByteArray(CoreIPC::DataReference(static_cast<uint8_t*>(m_certificateChain[i]->pbCertEncoded), m_certificateChain[i]->cbCertEncoded)); 121 122 } 122 123 … … 133 134 134 135 for (size_t i = 0; i < length; ++i) { 135 Vector<uint8_t> bytes;136 if (!decoder->decode Bytes(bytes)) {136 CoreIPC::DataReference dataReference; 137 if (!decoder->decodeVariableLengthByteArray(dataReference)) { 137 138 c.clearCertificateChain(); 138 139 return false; 139 140 } 140 141 141 PCCERT_CONTEXT certificateContext = ::CertCreateCertificateContext(PKCS_7_ASN_ENCODING | X509_ASN_ENCODING, bytes.data(), bytes.size());142 PCCERT_CONTEXT certificateContext = ::CertCreateCertificateContext(PKCS_7_ASN_ENCODING | X509_ASN_ENCODING, dataReference.data(), dataReference.size()); 142 143 if (!certificateContext) { 143 144 c.clearCertificateChain();
Note: See TracChangeset
for help on using the changeset viewer.