Changeset 182983 in webkit


Ignore:
Timestamp:
Apr 18, 2015, 7:42:08 AM (10 years ago)
Author:
Chris Dumez
Message:

Fix NetworkCache Statistics database bootstrapping after r182803
https://bugs.webkit.org/show_bug.cgi?id=143890

Reviewed by Darin Adler.

Update the NetworkCache Statistics database bootstrapping code to use
the records path instead of the version path. Also check that the
filenames in the folder are valid hashes to discard the *-body files.

  • NetworkProcess/cache/NetworkCache.cpp:

(WebKit::NetworkCache::Cache::recordsPath):
(WebKit::NetworkCache::Cache::storagePath): Deleted.

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

(WebKit::NetworkCache::Statistics::initialize):
(WebKit::NetworkCache::Statistics::bootstrapFromNetworkCache):
(WebKit::NetworkCache::Statistics::shrinkIfNeeded):

Location:
trunk/Source/WebKit2
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r182980 r182983  
     12015-04-18  Chris Dumez  <cdumez@apple.com>
     2
     3        Fix NetworkCache Statistics database bootstrapping after r182803
     4        https://bugs.webkit.org/show_bug.cgi?id=143890
     5
     6        Reviewed by Darin Adler.
     7
     8        Update the NetworkCache Statistics database bootstrapping code to use
     9        the records path instead of the version path. Also check that the
     10        filenames in the folder are valid hashes to discard the *-body files.
     11
     12        * NetworkProcess/cache/NetworkCache.cpp:
     13        (WebKit::NetworkCache::Cache::recordsPath):
     14        (WebKit::NetworkCache::Cache::storagePath): Deleted.
     15        * NetworkProcess/cache/NetworkCache.h:
     16        * NetworkProcess/cache/NetworkCacheStatistics.cpp:
     17        (WebKit::NetworkCache::Statistics::initialize):
     18        (WebKit::NetworkCache::Statistics::bootstrapFromNetworkCache):
     19        (WebKit::NetworkCache::Statistics::shrinkIfNeeded):
     20
    1212015-04-17  Tim Horton  <timothy_horton@apple.com>
    222
  • trunk/Source/WebKit2/NetworkProcess/cache/NetworkCache.cpp

    r182841 r182983  
    498498}
    499499
    500 String Cache::storagePath() const
    501 {
    502     return m_storage ? m_storage->versionPath() : String();
    503 }
    504 
    505 }
    506 }
    507 
    508 #endif
     500String Cache::recordsPath() const
     501{
     502    return m_storage ? m_storage->recordsPath() : String();
     503}
     504
     505}
     506}
     507
     508#endif
  • trunk/Source/WebKit2/NetworkProcess/cache/NetworkCache.h

    r182361 r182983  
    104104    void dumpContentsToFile();
    105105
    106     String storagePath() const;
     106    String recordsPath() const;
    107107
    108108private:
  • trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheStatistics.cpp

    r182365 r182983  
    9696
    9797    StringCapture databasePathCapture(databasePath);
    98     StringCapture networkCachePathCapture(singleton().storagePath());
     98    StringCapture networkCachePathCapture(singleton().recordsPath());
    9999    serialBackgroundIOQueue().dispatch([this, databasePathCapture, networkCachePathCapture, startTime] {
    100100        WebCore::SQLiteTransactionInProgressAutoCounter transactionCounter;
     
    145145
    146146    Vector<StringCapture> hashes;
    147     traverseCacheFiles(networkCachePath, [&hashes](const String& hash, const String&) {
    148         hashes.append(hash);
     147    traverseCacheFiles(networkCachePath, [&hashes](const String& hashString, const String&) {
     148        Key::HashType hash;
     149        if (!Key::stringToHash(hashString, hash))
     150            return;
     151
     152        hashes.append(hashString);
    149153    });
    150154
     
    170174    clear();
    171175
    172     StringCapture networkCachePathCapture(singleton().storagePath());
     176    StringCapture networkCachePathCapture(singleton().recordsPath());
    173177    serialBackgroundIOQueue().dispatch([this, networkCachePathCapture] {
    174178        bootstrapFromNetworkCache(networkCachePathCapture.string());
Note: See TracChangeset for help on using the changeset viewer.