Changeset 76474 in webkit


Ignore:
Timestamp:
Jan 23, 2011 5:00:57 PM (13 years ago)
Author:
Patrick Gansterer
Message:

2011-01-23 Patrick Gansterer <Patrick Gansterer>

Reviewed by Darin Adler.

Use WTF::StringHasher in WebCore
https://bugs.webkit.org/show_bug.cgi?id=52934

Add an additional function to calculate the hash
of data with a runtimedependent size.

  • wtf/StringHasher.h: (WTF::StringHasher::createBlobHash):

2011-01-23 Patrick Gansterer <Patrick Gansterer>

Reviewed by Darin Adler.

Use WTF::StringHasher in WebCore
https://bugs.webkit.org/show_bug.cgi?id=52934

  • loader/appcache/ApplicationCacheStorage.cpp: (WebCore::urlHostHash):
  • platform/LinkHash.cpp: (WebCore::visitedLinkHashInline):
  • platform/cf/BinaryPropertyList.cpp: (WebCore::IntegerArrayHash::hash):
  • platform/graphics/wx/FontPlatformDataWx.cpp: (WebCore::FontPlatformData::computeHash):
  • platform/network/ProtectionSpaceHash.h: (WebCore::ProtectionSpaceHash::hash):
Location:
trunk/Source
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r76471 r76474  
     12011-01-23  Patrick Gansterer  <paroga@webkit.org>
     2
     3        Reviewed by Darin Adler.
     4
     5        Use WTF::StringHasher in WebCore
     6        https://bugs.webkit.org/show_bug.cgi?id=52934
     7
     8        Add an additional function to calculate the hash
     9        of data with a runtimedependent size.
     10
     11        * wtf/StringHasher.h:
     12        (WTF::StringHasher::createBlobHash):
     13
    1142011-01-23  Patrick Gansterer  <paroga@webkit.org>
    215
  • trunk/Source/JavaScriptCore/wtf/StringHasher.h

    r69912 r76474  
    142142    }
    143143
     144    static inline unsigned createBlobHash(const void* data, unsigned size)
     145    {
     146        ASSERT(!(size % 2));
     147        return createHash<UChar>(static_cast<const UChar*>(data), size / sizeof(UChar));
     148    }
     149
    144150private:
    145151    static inline UChar defaultCoverter(UChar ch)
  • trunk/Source/WebCore/ChangeLog

    r76472 r76474  
     12011-01-23  Patrick Gansterer  <paroga@webkit.org>
     2
     3        Reviewed by Darin Adler.
     4
     5        Use WTF::StringHasher in WebCore
     6        https://bugs.webkit.org/show_bug.cgi?id=52934
     7
     8        * loader/appcache/ApplicationCacheStorage.cpp:
     9        (WebCore::urlHostHash):
     10        * platform/LinkHash.cpp:
     11        (WebCore::visitedLinkHashInline):
     12        * platform/cf/BinaryPropertyList.cpp:
     13        (WebCore::IntegerArrayHash::hash):
     14        * platform/graphics/wx/FontPlatformDataWx.cpp:
     15        (WebCore::FontPlatformData::computeHash):
     16        * platform/network/ProtectionSpaceHash.h:
     17        (WebCore::ProtectionSpaceHash::hash):
     18
    1192011-01-23  Patrick Gansterer  <paroga@webkit.org>
    220
  • trunk/Source/WebCore/loader/appcache/ApplicationCacheStorage.cpp

    r69048 r76474  
    9090    unsigned hostEnd = url.hostEnd();
    9191   
    92     return AlreadyHashed::avoidDeletedValue(StringImpl::computeHash(url.string().characters() + hostStart, hostEnd - hostStart));
     92    return AlreadyHashed::avoidDeletedValue(WTF::StringHasher::createHash(url.string().characters() + hostStart, hostEnd - hostStart));
    9393}
    9494
  • trunk/Source/WebCore/platform/LinkHash.cpp

    r67496 r76474  
    198198static ALWAYS_INLINE LinkHash visitedLinkHashInline(const UChar* url, unsigned length)
    199199{
    200     return AlreadyHashed::avoidDeletedValue(StringImpl::computeHash(url, length));
     200    return AlreadyHashed::avoidDeletedValue(WTF::StringHasher::createHash(url, length));
    201201}
    202202
  • trunk/Source/WebCore/platform/cf/BinaryPropertyList.cpp

    r65077 r76474  
    9393unsigned IntegerArrayHash::hash(const IntegerArray& array)
    9494{
    95     return StringImpl::computeHash(reinterpret_cast<const UChar*>(array.integers()), array.size() / (sizeof(int) / sizeof(UChar)));
     95    return WTF::StringHasher::createBlobHash(array.integers(), array.size());
    9696}
    9797
  • trunk/Source/WebCore/platform/graphics/wx/FontPlatformDataWx.cpp

    r70705 r76474  
    127127        thisFont->GetWeight(),
    128128        thisFont->GetUnderlined(),
    129         StringImpl::computeHash(thisFont->GetFaceName().utf8_str())
     129        WTF::StringHasher::createHash(thisFont->GetFaceName().utf8_str())
    130130    };
    131131
  • trunk/Source/WebCore/platform/network/ProtectionSpaceHash.h

    r54028 r76474  
    4343        };
    4444
    45         unsigned codeCount = sizeof(hashCodes) / sizeof(UChar);
     45        unsigned codeCount = sizeof(hashCodes);
    4646        // Ignore realm for proxies.
    4747        if (protectionSpace.isProxy())
    48             codeCount -= sizeof(hashCodes[0]) / sizeof(UChar);
    49         return StringImpl::computeHash(reinterpret_cast<UChar*>(hashCodes), codeCount);
     48            codeCount -= sizeof(hashCodes[0]);
     49        return WTF::StringHasher::createBlobHash(hashCodes, codeCount);
    5050    }
    5151   
Note: See TracChangeset for help on using the changeset viewer.