Changeset 59067 in webkit for trunk/JavaScriptCore
- Timestamp:
- May 10, 2010, 12:02:34 AM (15 years ago)
- Location:
- trunk/JavaScriptCore
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/ChangeLog
r59065 r59067 1 2010-05-09 Fumitoshi Ukai <[email protected]> 2 3 Reviewed by Eric Seidel. 4 5 JavaScriptCore/wtf/MD5.h: checksum should take a reference to output. 6 https://bugs.webkit.org/show_bug.cgi?id=38723 7 8 * JavaScriptCore.exp: 9 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: 10 * wtf/MD5.cpp: 11 (WTF::expectMD5): 12 Fix for checksum change. 13 (WTF::MD5::checksum): 14 Take a reference to output, instead of returning the result by value, to reduce coping for performance. 15 * wtf/MD5.h: 16 1 17 2010-05-09 Oliver Hunt <[email protected]> 2 18 -
trunk/JavaScriptCore/JavaScriptCore.exp
r58986 r59067 350 350 __ZN3WTF39initializeMainThreadToProcessMainThreadEv 351 351 __ZN3WTF3MD58addBytesEPKhm 352 __ZN3WTF3MD58checksumE v352 __ZN3WTF3MD58checksumERNS_6VectorIhLm16EEE 353 353 __ZN3WTF3MD5C1Ev 354 354 __ZN3WTF5Mutex4lockEv -
trunk/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def
r59001 r59067 90 90 ?checkCurrentIdentifierTable@Identifier@JSC@@CAXPAVJSGlobalData@2@@Z 91 91 ?checkSyntax@JSC@@YA?AVCompletion@1@PAVExecState@1@ABVSourceCode@1@@Z 92 ?checksum@MD5@WTF@@QAE ?AV?$Vector@E$0BA@@2@XZ92 ?checksum@MD5@WTF@@QAEXAAV?$Vector@E$0BA@@2@@Z 93 93 ?classInfo@InternalFunction@JSC@@UBEPBUClassInfo@2@XZ 94 94 ?classInfo@JSCell@JSC@@UBEPBUClassInfo@2@XZ -
trunk/JavaScriptCore/wtf/MD5.cpp
r58138 r59067 68 68 MD5 md5; 69 69 md5.addBytes(reinterpret_cast<const uint8_t*>(input.data()), input.length()); 70 Vector<uint8_t, 16> digest = md5.checksum(); 70 Vector<uint8_t, 16> digest; 71 md5.checksum(digest); 71 72 char* buf = 0; 72 73 CString actual = CString::newUninitialized(32, buf); … … 257 258 } 258 259 259 Vector<uint8_t, 16> MD5::checksum()260 void MD5::checksum(Vector<uint8_t, 16>& digest) 260 261 { 261 262 // Compute number of bytes mod 64 … … 292 293 MD5Transform(m_buf, reinterpret_cast<uint32_t*>(m_in)); 293 294 reverseBytes(reinterpret_cast<uint8_t*>(m_buf), 4); 294 Vector<uint8_t, 16> digest; 295 296 // Now, m_buf contains checksum result. 297 if (!digest.isEmpty()) 298 digest.clear(); 295 299 digest.append(reinterpret_cast<uint8_t*>(m_buf), 16); 296 300 … … 299 303 memset(m_bits, 0, sizeof(m_bits)); 300 304 memset(m_in, 0, sizeof(m_in)); 301 return digest;302 305 } 303 306 -
trunk/JavaScriptCore/wtf/MD5.h
r58136 r59067 47 47 48 48 // checksum has a side effect of resetting the state of the object. 49 Vector<uint8_t, 16> checksum();49 void checksum(Vector<uint8_t, 16>&); 50 50 51 51 private:
Note:
See TracChangeset
for help on using the changeset viewer.