Changeset 209189 in webkit


Ignore:
Timestamp:
Dec 1, 2016 11:31:06 AM (7 years ago)
Author:
Antti Koivisto
Message:

Revert r208931
https://bugs.webkit.org/show_bug.cgi?id=164924

PLT regression.

  • NetworkProcess/cache/NetworkCache.cpp:

(WebKit::NetworkCache::makeCacheKey):
(WebKit::NetworkCache::Cache::makeCacheKey): Deleted.

  • NetworkProcess/cache/NetworkCache.h:
  • NetworkProcess/cache/NetworkCacheBlobStorage.cpp:

(WebKit::NetworkCache::BlobStorage::BlobStorage):
(WebKit::NetworkCache::BlobStorage::add):
(WebKit::NetworkCache::BlobStorage::get):

  • NetworkProcess/cache/NetworkCacheBlobStorage.h:
  • NetworkProcess/cache/NetworkCacheData.cpp:

(WebKit::NetworkCache::computeSHA1):
(WebKit::NetworkCache::makeSalt): Deleted.
(WebKit::NetworkCache::readOrMakeSalt): Deleted.

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

(WebKit::NetworkCache::noPartitionString):
(WebKit::NetworkCache::Key::Key):
(WebKit::NetworkCache::Key::hasPartition):
(WebKit::NetworkCache::Key::computeHash):
(WebKit::NetworkCache::Key::hashAsString):
(WebKit::NetworkCache::Key::computePartitionHash): Deleted.

  • NetworkProcess/cache/NetworkCacheKey.h:

(WebKit::NetworkCache::Key::hash):
(WebKit::NetworkCache::Key::partitionHash): Deleted.
(WebKit::NetworkCache::Key::hashAsString): Deleted.
(WebKit::NetworkCache::Key::partitionHashAsString): Deleted.

  • NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:

(WebKit::NetworkCache::makeSubresourcesKey):
(WebKit::NetworkCache::constructRevalidationRequest):
(WebKit::NetworkCache::SpeculativeLoadManager::PendingFrameLoad::saveToDiskIfReady):
(WebKit::NetworkCache::SpeculativeLoadManager::retrieveSubresourcesEntry):

  • NetworkProcess/cache/NetworkCacheStorage.cpp:

(WebKit::NetworkCache::Storage::open):
(WebKit::NetworkCache::traverseRecordsFiles):
(WebKit::NetworkCache::Storage::Storage):
(WebKit::NetworkCache::Storage::recordDirectoryPathForKey):
(WebKit::NetworkCache::decodeRecordHeader):
(WebKit::NetworkCache::Storage::readRecord):
(WebKit::NetworkCache::Storage::encodeRecord):
(WebKit::NetworkCache::Storage::traverse):
(WebKit::NetworkCache::makeSaltFilePath): Deleted.

  • NetworkProcess/cache/NetworkCacheStorage.h:

(WebKit::NetworkCache::Storage::salt): Deleted.

Location:
trunk/Source/WebKit2
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r209184 r209189  
     12016-12-01  Antti Koivisto  <antti@apple.com>
     2
     3        Revert r208931
     4        https://bugs.webkit.org/show_bug.cgi?id=164924
     5
     6        PLT regression.
     7
     8        * NetworkProcess/cache/NetworkCache.cpp:
     9        (WebKit::NetworkCache::makeCacheKey):
     10        (WebKit::NetworkCache::Cache::makeCacheKey): Deleted.
     11        * NetworkProcess/cache/NetworkCache.h:
     12        * NetworkProcess/cache/NetworkCacheBlobStorage.cpp:
     13        (WebKit::NetworkCache::BlobStorage::BlobStorage):
     14        (WebKit::NetworkCache::BlobStorage::add):
     15        (WebKit::NetworkCache::BlobStorage::get):
     16        * NetworkProcess/cache/NetworkCacheBlobStorage.h:
     17        * NetworkProcess/cache/NetworkCacheData.cpp:
     18        (WebKit::NetworkCache::computeSHA1):
     19        (WebKit::NetworkCache::makeSalt): Deleted.
     20        (WebKit::NetworkCache::readOrMakeSalt): Deleted.
     21        * NetworkProcess/cache/NetworkCacheData.h:
     22        * NetworkProcess/cache/NetworkCacheKey.cpp:
     23        (WebKit::NetworkCache::noPartitionString):
     24        (WebKit::NetworkCache::Key::Key):
     25        (WebKit::NetworkCache::Key::hasPartition):
     26        (WebKit::NetworkCache::Key::computeHash):
     27        (WebKit::NetworkCache::Key::hashAsString):
     28        (WebKit::NetworkCache::Key::computePartitionHash): Deleted.
     29        * NetworkProcess/cache/NetworkCacheKey.h:
     30        (WebKit::NetworkCache::Key::hash):
     31        (WebKit::NetworkCache::Key::partitionHash): Deleted.
     32        (WebKit::NetworkCache::Key::hashAsString): Deleted.
     33        (WebKit::NetworkCache::Key::partitionHashAsString): Deleted.
     34        * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
     35        (WebKit::NetworkCache::makeSubresourcesKey):
     36        (WebKit::NetworkCache::constructRevalidationRequest):
     37        (WebKit::NetworkCache::SpeculativeLoadManager::PendingFrameLoad::saveToDiskIfReady):
     38        (WebKit::NetworkCache::SpeculativeLoadManager::retrieveSubresourcesEntry):
     39        * NetworkProcess/cache/NetworkCacheStorage.cpp:
     40        (WebKit::NetworkCache::Storage::open):
     41        (WebKit::NetworkCache::traverseRecordsFiles):
     42        (WebKit::NetworkCache::Storage::Storage):
     43        (WebKit::NetworkCache::Storage::recordDirectoryPathForKey):
     44        (WebKit::NetworkCache::decodeRecordHeader):
     45        (WebKit::NetworkCache::Storage::readRecord):
     46        (WebKit::NetworkCache::Storage::encodeRecord):
     47        (WebKit::NetworkCache::Storage::traverse):
     48        (WebKit::NetworkCache::makeSaltFilePath): Deleted.
     49        * NetworkProcess/cache/NetworkCacheStorage.h:
     50        (WebKit::NetworkCache::Storage::salt): Deleted.
     51
    1522016-11-30  Sam Weinig  <sam@webkit.org>
    253
  • trunk/Source/WebKit2/NetworkProcess/cache/NetworkCache.cpp

    r208985 r209189  
    115115}
    116116
    117 Key Cache::makeCacheKey(const WebCore::ResourceRequest& request)
     117static Key makeCacheKey(const WebCore::ResourceRequest& request)
    118118{
    119119#if ENABLE(CACHE_PARTITIONING)
     
    126126    // ranges so only the same exact range request will be served from the cache.
    127127    String range = request.httpHeaderField(WebCore::HTTPHeaderName::Range);
    128     return { partition, resourceType(), range, request.url().string(), m_storage->salt() };
     128    return { partition, resourceType(), range, request.url().string() };
    129129}
    130130
  • trunk/Source/WebKit2/NetworkProcess/cache/NetworkCache.h

    r208931 r209189  
    130130    ~Cache() = delete;
    131131
    132     Key makeCacheKey(const WebCore::ResourceRequest&);
    133 
    134132    String dumpFilePath() const;
    135133    void deleteDumpFile();
  • trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheBlobStorage.cpp

    r208931 r209189  
    4141namespace NetworkCache {
    4242
    43 BlobStorage::BlobStorage(const String& blobDirectoryPath, Salt salt)
     43BlobStorage::BlobStorage(const String& blobDirectoryPath)
    4444    : m_blobDirectoryPath(blobDirectoryPath)
    45     , m_salt(salt)
    4645{
    4746}
     
    8786    ASSERT(!RunLoop::isMain());
    8887
    89     auto hash = computeSHA1(data, m_salt);
     88    auto hash = computeSHA1(data);
    9089    if (data.isEmpty())
    9190        return { data, hash };
     
    125124    auto data = mapFile(linkPath.data());
    126125
    127     return { data, computeSHA1(data, m_salt) };
     126    return { data, computeSHA1(data) };
    128127}
    129128
  • trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheBlobStorage.h

    r208931 r209189  
    4040    WTF_MAKE_NONCOPYABLE(BlobStorage);
    4141public:
    42     BlobStorage(const String& blobDirectoryPath, Salt);
     42    BlobStorage(const String& blobDirectoryPath);
    4343
    4444    struct Blob {
     
    6464
    6565    const String m_blobDirectoryPath;
    66     const Salt m_salt;
    6766
    6867    std::atomic<size_t> m_approximateSize { 0 };
  • trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheData.cpp

    r208985 r209189  
    2929#if ENABLE(NETWORK_CACHE)
    3030
    31 #include <WebCore/FileSystem.h>
    3231#include <fcntl.h>
    3332#include <sys/mman.h>
    3433#include <sys/stat.h>
    35 #include <wtf/CryptographicallyRandomNumber.h>
    3634
    3735namespace WebKit {
     
    106104}
    107105
    108 SHA1::Digest computeSHA1(const Data& data, const Salt& salt)
     106SHA1::Digest computeSHA1(const Data& data)
    109107{
    110108    SHA1 sha1;
    111     sha1.addBytes(salt.data(), salt.size());
    112109    data.apply([&sha1](const uint8_t* data, size_t size) {
    113110        sha1.addBytes(data, size);
    114111        return true;
    115112    });
    116 
    117113    SHA1::Digest digest;
    118114    sha1.computeHash(digest);
     
    129125}
    130126
    131 static Salt makeSalt()
    132 {
    133     Salt salt;
    134     static_assert(salt.size() == 8, "Salt size");
    135     *reinterpret_cast<uint32_t*>(&salt[0]) = cryptographicallyRandomNumber();
    136     *reinterpret_cast<uint32_t*>(&salt[4]) = cryptographicallyRandomNumber();
    137     return salt;
    138 }
    139 
    140 std::optional<Salt> readOrMakeSalt(const String& path)
    141 {
    142     auto cpath = WebCore::fileSystemRepresentation(path);
    143     auto fd = open(cpath.data(), O_RDONLY, 0);
    144     Salt salt;
    145     auto bytesRead = read(fd, salt.data(), salt.size());
    146     close(fd);
    147     if (bytesRead != salt.size()) {
    148         salt = makeSalt();
    149 
    150         unlink(cpath.data());
    151         fd = open(cpath.data(), O_WRONLY | O_CREAT | O_TRUNC, S_IRUSR | S_IWUSR);
    152         bool success = write(fd, salt.data(), salt.size()) == salt.size();
    153         close(fd);
    154         if (!success)
    155             return { };
    156     }
    157     return salt;
    158 }
    159 
    160127} // namespace NetworkCache
    161128} // namespace WebKit
  • trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheData.h

    r208985 r209189  
    157157Data adoptAndMapFile(int fd, size_t offset, size_t);
    158158Data mapFile(const char* path);
    159 
    160 using Salt = std::array<uint8_t, 8>;
    161 
    162 std::optional<Salt> readOrMakeSalt(const String& path);
    163 SHA1::Digest computeSHA1(const Data&, const Salt&);
     159SHA1::Digest computeSHA1(const Data&);
    164160
    165161}
  • trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheKey.cpp

    r208931 r209189  
    3838namespace NetworkCache {
    3939
     40static const String& noPartitionString()
     41{
     42    static NeverDestroyed<String> noPartition(ASCIILiteral("No partition"));
     43    return noPartition;
     44}
     45
    4046Key::Key(const Key& o)
    4147    : m_partition(o.m_partition.isolatedCopy())
     
    4450    , m_range(o.m_range.isolatedCopy())
    4551    , m_hash(o.m_hash)
    46     , m_partitionHash(o.m_partitionHash)
    4752{
    4853}
    4954
    50 Key::Key(const String& partition, const String& type, const String& range, const String& identifier, const Salt& salt)
    51     : m_partition(partition)
     55Key::Key(const String& partition, const String& type, const String& range, const String& identifier)
     56    : m_partition(partition.isEmpty() ? noPartitionString() : partition)
    5257    , m_type(type)
    5358    , m_identifier(identifier)
    5459    , m_range(range)
    55     , m_hash(computeHash(salt))
    56     , m_partitionHash(computePartitionHash(salt))
     60    , m_hash(computeHash())
    5761{
    5862}
     
    6165    : m_identifier(WTF::HashTableDeletedValue)
    6266{
     67}
     68
     69bool Key::hasPartition() const
     70{
     71    return m_partition != noPartitionString();
    6372}
    6473
     
    8998}
    9099
    91 Key::HashType Key::computeHash(const Salt& salt) const
     100Key::HashType Key::computeHash() const
    92101{
    93102    // We don't really need a cryptographic hash. The key is always verified against the entry header.
    94103    // SHA1 just happens to be suitably sized, fast and available.
    95104    SHA1 sha1;
    96     sha1.addBytes(salt.data(), salt.size());
    97 
    98105    hashString(sha1, m_partition);
    99106    hashString(sha1, m_type);
    100107    hashString(sha1, m_identifier);
    101108    hashString(sha1, m_range);
    102 
    103109    SHA1::Digest hash;
    104110    sha1.computeHash(hash);
     
    106112}
    107113
    108 Key::HashType Key::computePartitionHash(const Salt& salt) const
    109 {
    110     SHA1 sha1;
    111     sha1.addBytes(salt.data(), salt.size());
    112 
    113     hashString(sha1, m_partition);
    114 
    115     SHA1::Digest hash;
    116     sha1.computeHash(hash);
    117     return hash;
    118 }
    119 
    120 String Key::hashAsString(const HashType& hash)
     114String Key::hashAsString() const
    121115{
    122116    StringBuilder builder;
    123117    builder.reserveCapacity(hashStringLength());
    124     for (auto byte : hash) {
     118    for (auto byte : m_hash) {
    125119        builder.append(upperNibbleToASCIIHexDigit(byte));
    126120        builder.append(lowerNibbleToASCIIHexDigit(byte));
  • trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheKey.h

    r208931 r209189  
    2929#if ENABLE(NETWORK_CACHE)
    3030
    31 #include "NetworkCacheData.h"
    3231#include <wtf/SHA1.h>
    3332#include <wtf/text/WTFString.h>
     
    4645    Key(const Key&);
    4746    Key(Key&&) = default;
    48     Key(const String& partition, const String& type, const String& range, const String& identifier, const Salt&);
     47    Key(const String& partition, const String& type, const String& range, const String& identifier);
    4948
    5049    Key& operator=(const Key&);
     
    5655    bool isNull() const { return m_identifier.isNull(); }
    5756
     57    bool hasPartition() const;
    5858    const String& partition() const { return m_partition; }
    5959    const String& identifier() const { return m_identifier; }
     
    6161    const String& range() const { return m_range; }
    6262
    63     const HashType& hash() const { return m_hash; }
    64     const HashType& partitionHash() const { return m_partitionHash; }
     63    HashType hash() const { return m_hash; }
    6564
    6665    static bool stringToHash(const String&, HashType&);
    6766
    6867    static size_t hashStringLength() { return 2 * sizeof(m_hash); }
    69     String hashAsString() const { return hashAsString(m_hash); }
    70     String partitionHashAsString() const { return hashAsString(m_partitionHash); }
     68    String hashAsString() const;
    7169
    7270    void encode(Encoder&) const;
     
    7775
    7876private:
    79     static String hashAsString(const HashType&);
    80     HashType computeHash(const Salt&) const;
    81     HashType computePartitionHash(const Salt&) const;
     77    HashType computeHash() const;
    8278
    8379    String m_partition;
     
    8682    String m_range;
    8783    HashType m_hash;
    88     HashType m_partitionHash;
    8984};
    9085
  • trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp

    r208985 r209189  
    8080}
    8181
    82 static inline Key makeSubresourcesKey(const Key& resourceKey, const Salt& salt)
    83 {
    84     return Key(resourceKey.partition(), subresourcesType(), resourceKey.range(), resourceKey.identifier(), salt);
     82static inline Key makeSubresourcesKey(const Key& resourceKey)
     83{
     84    return Key(resourceKey.partition(), subresourcesType(), resourceKey.range(), resourceKey.identifier());
    8585}
    8686
     
    9191    revalidationRequest.setFirstPartyForCookies(subResourceInfo.firstPartyForCookies());
    9292#if ENABLE(CACHE_PARTITIONING)
    93     if (!entry.key().partition().isEmpty())
     93    if (entry.key().hasPartition())
    9494        revalidationRequest.setCachePartition(entry.key().partition());
    9595#endif
     
    227227            m_storage.store(m_existingEntry->encodeAsStorageRecord(), [](const Data&) { });
    228228        } else {
    229             SubresourcesEntry entry(makeSubresourcesKey(m_mainResourceKey, m_storage.salt()), m_subresourceLoads);
     229            SubresourcesEntry entry(makeSubresourcesKey(m_mainResourceKey), m_subresourceLoads);
    230230            m_storage.store(entry.encodeAsStorageRecord(), [](const Data&) { });
    231231        }
     
    522522{
    523523    ASSERT(storageKey.type() == "Resource");
    524     auto subresourcesStorageKey = makeSubresourcesKey(storageKey, m_storage.salt());
     524    auto subresourcesStorageKey = makeSubresourcesKey(storageKey);
    525525    m_storage.retrieve(subresourcesStorageKey, static_cast<unsigned>(ResourceLoadPriority::Medium), [completionHandler = WTFMove(completionHandler)](auto record) {
    526526        if (!record) {
  • trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheStorage.cpp

    r208985 r209189  
    4343namespace NetworkCache {
    4444
    45 static const char saltFileName[] = "salt";
    4645static const char versionDirectoryPrefix[] = "Version ";
    4746static const char recordsDirectoryName[] = "Records";
     
    129128};
    130129
     130std::unique_ptr<Storage> Storage::open(const String& cachePath)
     131{
     132    ASSERT(RunLoop::isMain());
     133
     134    if (!WebCore::makeAllDirectories(cachePath))
     135        return nullptr;
     136    return std::unique_ptr<Storage>(new Storage(cachePath));
     137}
     138
    131139static String makeVersionedDirectoryPath(const String& baseDirectoryPath)
    132140{
     
    145153}
    146154
    147 static String makeSaltFilePath(const String& baseDirectoryPath)
    148 {
    149     return WebCore::pathByAppendingComponent(makeVersionedDirectoryPath(baseDirectoryPath), saltFileName);
    150 }
    151 
    152 std::unique_ptr<Storage> Storage::open(const String& cachePath)
    153 {
    154     ASSERT(RunLoop::isMain());
    155 
    156     if (!WebCore::makeAllDirectories(makeVersionedDirectoryPath(cachePath)))
    157         return nullptr;
    158     auto salt = readOrMakeSalt(makeSaltFilePath(cachePath));
    159     if (!salt)
    160         return nullptr;
    161     return std::unique_ptr<Storage>(new Storage(cachePath, *salt));
    162 }
    163 
    164 void traverseRecordsFiles(const String& recordsPath, const String& expectedType, const RecordFileTraverseFunction& function)
    165 {
    166     traverseDirectory(recordsPath, [&](const String& partitionName, DirectoryEntryType entryType) {
     155void traverseRecordsFiles(const String& recordsPath, const String& expectedType, const std::function<void (const String& fileName, const String& hashString, const String& type, bool isBlob, const String& recordDirectoryPath)>& function)
     156{
     157    traverseDirectory(recordsPath, [&recordsPath, &function, &expectedType](const String& partitionName, DirectoryEntryType entryType) {
    167158        if (entryType != DirectoryEntryType::Directory)
    168159            return;
    169160        String partitionPath = WebCore::pathByAppendingComponent(recordsPath, partitionName);
    170         traverseDirectory(partitionPath, [&](const String& actualType, DirectoryEntryType entryType) {
     161        traverseDirectory(partitionPath, [&function, &partitionPath, &expectedType](const String& actualType, DirectoryEntryType entryType) {
    171162            if (entryType != DirectoryEntryType::Directory)
    172163                return;
     
    208199}
    209200
    210 Storage::Storage(const String& baseDirectoryPath, Salt salt)
     201Storage::Storage(const String& baseDirectoryPath)
    211202    : m_basePath(baseDirectoryPath)
    212203    , m_recordsPath(makeRecordsDirectoryPath(baseDirectoryPath))
    213     , m_salt(salt)
    214204    , m_readOperationTimeoutTimer(*this, &Storage::cancelAllReadOperations)
    215205    , m_writeOperationDispatchTimer(*this, &Storage::dispatchPendingWriteOperations)
     
    217207    , m_backgroundIOQueue(WorkQueue::create("com.apple.WebKit.Cache.Storage.background", WorkQueue::Type::Concurrent, WorkQueue::QOS::Background))
    218208    , m_serialBackgroundIOQueue(WorkQueue::create("com.apple.WebKit.Cache.Storage.serialBackground", WorkQueue::Type::Serial, WorkQueue::QOS::Background))
    219     , m_blobStorage(makeBlobDirectoryPath(baseDirectoryPath), m_salt)
     209    , m_blobStorage(makeBlobDirectoryPath(baseDirectoryPath))
    220210{
    221211    deleteOldVersions();
     
    337327String Storage::recordDirectoryPathForKey(const Key& key) const
    338328{
     329    ASSERT(!key.partition().isEmpty());
    339330    ASSERT(!key.type().isEmpty());
    340     return WebCore::pathByAppendingComponent(WebCore::pathByAppendingComponent(recordsPath(), key.partitionHashAsString()), key.type());
     331    return WebCore::pathByAppendingComponent(WebCore::pathByAppendingComponent(recordsPath(), key.partition()), key.type());
    341332}
    342333
     
    407398}
    408399
    409 static bool decodeRecordHeader(const Data& fileData, RecordMetaData& metaData, Data& headerData, const Salt& salt)
     400static bool decodeRecordHeader(const Data& fileData, RecordMetaData& metaData, Data& headerData)
    410401{
    411402    if (!decodeRecordMetaData(metaData, fileData)) {
     
    420411
    421412    headerData = fileData.subrange(metaData.headerOffset, metaData.headerSize);
    422     if (metaData.headerHash != computeSHA1(headerData, salt)) {
     413    if (metaData.headerHash != computeSHA1(headerData)) {
    423414        LOG(NetworkCacheStorage, "(NetworkProcess) header checksum mismatch");
    424415        return false;
     
    433424    RecordMetaData metaData;
    434425    Data headerData;
    435     if (!decodeRecordHeader(recordData, metaData, headerData, m_salt))
     426    if (!decodeRecordHeader(recordData, metaData, headerData))
    436427        return;
    437428
     
    450441            return;
    451442        bodyData = recordData.subrange(bodyOffset, metaData.bodySize);
    452         if (metaData.bodyHash != computeSHA1(bodyData, m_salt))
     443        if (metaData.bodyHash != computeSHA1(bodyData))
    453444            return;
    454445    }
     
    512503    RecordMetaData metaData(record.key);
    513504    metaData.epochRelativeTimeStamp = std::chrono::duration_cast<std::chrono::milliseconds>(record.timeStamp.time_since_epoch());
    514     metaData.headerHash = computeSHA1(record.header, m_salt);
     505    metaData.headerHash = computeSHA1(record.header);
    515506    metaData.headerSize = record.header.size();
    516     metaData.bodyHash = blob ? blob.value().hash : computeSHA1(record.body, m_salt);
     507    metaData.bodyHash = blob ? blob.value().hash : computeSHA1(record.body);
    517508    metaData.bodySize = record.body.size();
    518509    metaData.isBodyInline = !blob;
     
    833824                RecordMetaData metaData;
    834825                Data headerData;
    835                 if (decodeRecordHeader(fileData, metaData, headerData, m_salt)) {
     826                if (decodeRecordHeader(fileData, metaData, headerData)) {
    836827                    Record record {
    837828                        metaData.key,
  • trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheStorage.h

    r208985 r209189  
    8888    size_t approximateSize() const;
    8989
    90     static const unsigned version = 11;
     90    static const unsigned version = 10;
    9191#if PLATFORM(MAC)
    9292    /// Allow the last stable version of the cache to co-exist with the latest development one.
     
    9898    String recordsPath() const;
    9999
    100     const Salt& salt() const { return m_salt; }
    101 
    102100    ~Storage();
    103101
    104102private:
    105     Storage(const String& directoryPath, Salt);
     103    Storage(const String& directoryPath);
    106104
    107105    String recordDirectoryPathForKey(const Key&) const;
     
    144142    const String m_recordsPath;
    145143
    146     const Salt m_salt;
    147 
    148144    size_t m_capacity { std::numeric_limits<size_t>::max() };
    149145    size_t m_approximateRecordsSize { 0 };
     
    180176
    181177// FIXME: Remove, used by NetworkCacheStatistics only.
    182 using RecordFileTraverseFunction = std::function<void (const String& fileName, const String& hashString, const String& type, bool isBlob, const String& recordDirectoryPath)>;
    183 void traverseRecordsFiles(const String& recordsPath, const String& type, const RecordFileTraverseFunction&);
     178void traverseRecordsFiles(const String& recordsPath, const String& type, const std::function<void (const String& fileName, const String& hashString, const String& type, bool isBodyBlob, const String& recordDirectoryPath)>&);
    184179
    185180}
Note: See TracChangeset for help on using the changeset viewer.