Changeset 179704 in webkit


Ignore:
Timestamp:
Feb 5, 2015 1:48:16 PM (9 years ago)
Author:
Chris Dumez
Message:

[WK2][Cocoa] Populate m_contentsFilter bloom filter from the main dispatch queue NetworkCacheStorage::initialize()
https://bugs.webkit.org/show_bug.cgi?id=141297

Reviewed by Antti Koivisto.

Populate m_contentsFilter bloom filter from the main dispatch queue
NetworkCacheStorage::initialize() to avoid thread-safety issues.

  • NetworkProcess/cache/NetworkCacheStorageCocoa.mm:

(WebKit::NetworkCacheStorage::initialize):

Location:
trunk/Source/WebKit2
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r179703 r179704  
     12015-02-05  Chris Dumez  <cdumez@apple.com>
     2
     3        [WK2][Cocoa] Populate m_contentsFilter bloom filter from the main dispatch queue NetworkCacheStorage::initialize()
     4        https://bugs.webkit.org/show_bug.cgi?id=141297
     5
     6        Reviewed by Antti Koivisto.
     7
     8        Populate m_contentsFilter bloom filter from the main dispatch queue
     9        NetworkCacheStorage::initialize() to avoid thread-safety issues.
     10
     11        * NetworkProcess/cache/NetworkCacheStorageCocoa.mm:
     12        (WebKit::NetworkCacheStorage::initialize):
     13
    1142015-02-05  Chris Dumez  <cdumez@apple.com>
    215
  • trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheStorageCocoa.mm

    r179703 r179704  
    130130
    131131    StringCapture cachePathCapture(m_directoryPath);
    132     auto& diskContentsFilter = m_contentsFilter;
    133132    auto& entryCount = m_approximateEntryCount;
    134133
    135     dispatch_async(m_backgroundIOQueue.get(), [cachePathCapture, &diskContentsFilter, &entryCount] {
     134    dispatch_async(m_backgroundIOQueue.get(), [this, cachePathCapture, &entryCount] {
    136135        String cachePath = cachePathCapture.string();
    137         traverseCacheFiles(cachePath, [&diskContentsFilter, &entryCount](const String& fileName, const String&) {
     136        traverseCacheFiles(cachePath, [this, &entryCount](const String& fileName, const String&) {
    138137            NetworkCacheKey::HashType hash;
    139138            if (!NetworkCacheKey::stringToHash(fileName, hash))
    140139                return;
    141             diskContentsFilter.add(hash);
     140            dispatch_async(dispatch_get_main_queue(), [this, hash] {
     141                m_contentsFilter.add(hash);
     142            });
    142143            ++entryCount;
    143144        });
Note: See TracChangeset for help on using the changeset viewer.