Changeset 179781 in webkit


Ignore:
Timestamp:
Feb 7, 2015 11:45:15 AM (9 years ago)
Author:
Antti Koivisto
Message:

Use longer hashes for cache keys
https://bugs.webkit.org/show_bug.cgi?id=141356

Rubber-stamped by Darin Adler.

Folloup and build fix.

  • NetworkProcess/cache/NetworkCacheCoders.h:
  • NetworkProcess/cache/NetworkCacheKey.cpp:

(WebKit::hashString):

Use containsOnlyASCII instead of is8Bit so both paths always compute the same hash.

  • NetworkProcess/cache/NetworkCacheKey.h:
Location:
trunk/Source/WebKit2
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r179780 r179781  
     12015-02-07  Antti Koivisto  <antti@apple.com>
     2
     3        Use longer hashes for cache keys
     4        https://bugs.webkit.org/show_bug.cgi?id=141356
     5
     6        Rubber-stamped by Darin Adler.
     7
     8        Folloup and build fix.
     9
     10        * NetworkProcess/cache/NetworkCacheCoders.h:
     11        * NetworkProcess/cache/NetworkCacheKey.cpp:
     12        (WebKit::hashString):
     13
     14            Use containsOnlyASCII instead of is8Bit so both paths always compute the same hash.
     15
     16        * NetworkProcess/cache/NetworkCacheKey.h:
     17
    1182015-02-07  Antti Koivisto  <antti@apple.com>
    219
  • trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheCoders.h

    r179779 r179781  
    3636#include <wtf/HashMap.h>
    3737#include <wtf/HashSet.h>
     38#include <wtf/MD5.h>
    3839#include <wtf/Vector.h>
    39 #include <wtf/md5.h>
    4040
    4141namespace WebKit {
  • trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheKey.cpp

    r179779 r179781  
    6363{
    6464    const uint8_t zero = 0;
    65     if (string.is8Bit()) {
     65    if (string.containsOnlyASCII()) {
    6666        md5.addBytes(string.characters8(), string.length());
    6767        md5.addBytes(&zero, 1);
     
    8989{
    9090    StringBuilder builder;
     91    builder.reserveCapacity(hashStringLength());
    9192    for (auto byte : m_hash) {
    9293        builder.append(upperNibbleToASCIIHexDigit(byte));
  • trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheKey.h

    r179779 r179781  
    2929#if ENABLE(NETWORK_CACHE)
    3030
    31 #include <wtf/md5.h>
     31#include <wtf/MD5.h>
    3232#include <wtf/text/WTFString.h>
    3333
Note: See TracChangeset for help on using the changeset viewer.