Changeset 228078 in webkit


Ignore:
Timestamp:
Feb 4, 2018 9:30:56 PM (6 years ago)
Author:
jmarcell@apple.com
Message:

Cherry-pick r228041. rdar://problem/37220123

Location:
branches/safari-605-branch/Source/WebKit
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/safari-605-branch/Source/WebKit/ChangeLog

    r228074 r228078  
     12018-02-04  Jason Marcell  <jmarcell@apple.com>
     2
     3        Cherry-pick r228041. rdar://problem/37220123
     4
     5    2018-02-02  Youenn Fablet  <youenn@apple.com>
     6
     7            CacheStorage should check for origin file presence when computing the origin of a folder
     8            https://bugs.webkit.org/show_bug.cgi?id=182454
     9
     10            Reviewed by Chris Dumez.
     11
     12            In case caches is opened for an origin but no cache is added, we do not have a caches name file but we do have an origin filename.
     13            We should be checking the origin filename anyway since we will be reading it afterwards.
     14
     15            * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
     16            (WebKit::CacheStorage::Caches::retrieveOriginFromDirectory):
     17
    1182018-02-04  Jason Marcell  <jmarcell@apple.com>
    219
  • branches/safari-605-branch/Source/WebKit/NetworkProcess/cache/CacheStorageEngineCaches.cpp

    r227835 r228078  
    5858void Caches::retrieveOriginFromDirectory(const String& folderPath, WorkQueue& queue, WTF::CompletionHandler<void(std::optional<WebCore::ClientOrigin>&&)>&& completionHandler)
    5959{
    60     queue.dispatch([completionHandler = WTFMove(completionHandler), folderPath = folderPath.isolatedCopy()]() mutable {
    61         if (!WebCore::FileSystem::fileExists(cachesListFilename(folderPath))) {
     60    queue.dispatch([completionHandler = WTFMove(completionHandler), filename = cachesOriginFilename(folderPath)]() mutable {
     61        if (!WebCore::FileSystem::fileExists(filename)) {
    6262            RunLoop::main().dispatch([completionHandler = WTFMove(completionHandler)]() mutable {
    6363                completionHandler(std::nullopt);
     
    6666        }
    6767
    68         auto channel = IOChannel::open(cachesOriginFilename(folderPath), IOChannel::Type::Read);
     68        auto channel = IOChannel::open(filename, IOChannel::Type::Read);
    6969        channel->read(0, std::numeric_limits<size_t>::max(), nullptr, [completionHandler = WTFMove(completionHandler)](const Data& data, int error) mutable {
    7070            ASSERT(RunLoop::isMain());
Note: See TracChangeset for help on using the changeset viewer.