Changeset 179703 in webkit


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

Use deleteFile() in NetworkCacheStorageCocoa.mm
https://bugs.webkit.org/show_bug.cgi?id=141299

Reviewed by Antti Koivisto.

Use deleteFile() in NetworkCacheStorageCocoa.mm to simplify the code
a bit.

  • NetworkProcess/cache/NetworkCacheStorageCocoa.mm:

(WebKit::NetworkCacheStorage::removeEntry):
(WebKit::NetworkCacheStorage::clear):
(WebKit::NetworkCacheStorage::shrinkIfNeeded):

Location:
trunk/Source/WebKit2
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r179690 r179703  
     12015-02-05  Chris Dumez  <cdumez@apple.com>
     2
     3        Use deleteFile() in NetworkCacheStorageCocoa.mm
     4        https://bugs.webkit.org/show_bug.cgi?id=141299
     5
     6        Reviewed by Antti Koivisto.
     7
     8        Use deleteFile() in NetworkCacheStorageCocoa.mm to simplify the code
     9        a bit.
     10
     11        * NetworkProcess/cache/NetworkCacheStorageCocoa.mm:
     12        (WebKit::NetworkCacheStorage::removeEntry):
     13        (WebKit::NetworkCacheStorage::clear):
     14        (WebKit::NetworkCacheStorage::shrinkIfNeeded):
     15
    1162015-02-04  Antti Koivisto  <antti@apple.com>
    217
  • trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheStorageCocoa.mm

    r179690 r179703  
    346346    StringCapture filePathCapture(filePathForKey(key, m_directoryPath));
    347347    dispatch_async(m_ioQueue.get(), [this, filePathCapture] {
    348         CString path = WebCore::fileSystemRepresentation(filePathCapture.string());
    349         unlink(path.data());
     348        WebCore::deleteFile(filePathCapture.string());
    350349        if (m_approximateEntryCount)
    351350            --m_approximateEntryCount;
     
    551550            String subdirPath = WebCore::pathByAppendingComponent(directoryPath, subdirName);
    552551            traverseDirectory(subdirPath, DT_REG, [&subdirPath](const String& fileName) {
    553                 String filePath = WebCore::pathByAppendingComponent(subdirPath, fileName);
    554                 unlink(WebCore::fileSystemRepresentation(filePath).data());
     552                WebCore::deleteFile(WebCore::pathByAppendingComponent(subdirPath, fileName));
    555553            });
    556554            rmdir(WebCore::fileSystemRepresentation(subdirPath).data());
     
    579577        size_t foundEntryCount = 0;
    580578        size_t deletedCount = 0;
    581         traverseCacheFiles(cachePath, [this, &foundEntryCount, &deletedCount](const String& fileName, const String& directory) {
    582             String partitionPath = WebCore::pathByAppendingComponent(directory, fileName);
    583             CString path = WebCore::fileSystemRepresentation(partitionPath);
     579        traverseCacheFiles(cachePath, [this, &foundEntryCount, &deletedCount](const String& fileName, const String& partitionPath) {
    584580            ++foundEntryCount;
    585581            if (foundEntryCount % everyNthResourceToDelete)
     
    587583            ++deletedCount;
    588584
    589             unlink(path.data());
     585            WebCore::deleteFile(WebCore::pathByAppendingComponent(partitionPath, fileName));
    590586
    591587            NetworkCacheKey::HashType hash;
Note: See TracChangeset for help on using the changeset viewer.