Changeset 31458 in webkit
- Timestamp:
- Mar 31, 2008 9:52:09 AM (16 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r31457 r31458 1 2008-03-29 Adam Roben <aroben@apple.com> 2 3 Fix Bug 18214: WebKit will sometimes load duplicate plugins 4 5 <http://bugs.webkit.org/show_bug.cgi?id=18214> 6 7 We now compare 3 things to determine if two PluginPackages are equal: 8 1) Name 9 2) Description 10 3) Supported MIME types 11 12 This matches Gecko's equality logic for plugins (implemented in 13 nsPluginTag::Equals). 14 15 Reviewed by Darin Adler. 16 17 * plugins/win/PluginPackageWin.cpp: 18 (WebCore::PluginPackage::hash): Use the above-mentioned 3 criteria to 19 calculate the hash. 20 (WebCore::PluginPackage::equal): Use the above-mentioned 3 criteria to 21 determine equality. 22 1 23 2008-03-31 Simon Hausmann <hausmann@webkit.org> 2 24 -
trunk/WebCore/plugins/win/PluginPackageWin.cpp
r30698 r31458 361 361 unsigned PluginPackage::hash() const 362 362 { 363 const unsigned hashCodes[3] = { 363 const unsigned hashCodes[] = { 364 m_name.impl()->hash(), 364 365 m_description.impl()->hash(), 365 m_lastModified.dwLowDateTime, 366 m_lastModified.dwHighDateTime 366 m_mimeToExtensions.size() 367 367 }; 368 368 369 return StringImpl::computeHash(reinterpret_cast<const UChar*>(hashCodes), 3 * sizeof(unsigned) / sizeof(UChar));369 return StringImpl::computeHash(reinterpret_cast<const UChar*>(hashCodes), sizeof(hashCodes) / sizeof(UChar)); 370 370 } 371 371 372 372 bool PluginPackage::equal(const PluginPackage& a, const PluginPackage& b) 373 373 { 374 return a.m_description == b.m_description && (CompareFileTime(&a.m_lastModified, &b.m_lastModified) == 0); 375 } 376 377 } 374 if (a.m_name != b.m_name) 375 return false; 376 377 if (a.m_description != b.m_description) 378 return false; 379 380 if (a.m_mimeToExtensions.size() != b.m_mimeToExtensions.size()) 381 return false; 382 383 MIMEToExtensionsMap::const_iterator::Keys end = a.m_mimeToExtensions.end().keys(); 384 for (MIMEToExtensionsMap::const_iterator::Keys it = a.m_mimeToExtensions.begin().keys(); it != end; ++it) { 385 if (!b.m_mimeToExtensions.contains(*it)) 386 return false; 387 } 388 389 return true; 390 } 391 392 }
Note: See TracChangeset
for help on using the changeset viewer.