Title: [228078] branches/safari-605-branch/Source/WebKit
Revision
228078
Author
jmarc...@apple.com
Date
2018-02-04 21:30:56 -0800 (Sun, 04 Feb 2018)

Log Message

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

Modified Paths

Diff

Modified: branches/safari-605-branch/Source/WebKit/ChangeLog (228077 => 228078)


--- branches/safari-605-branch/Source/WebKit/ChangeLog	2018-02-05 05:30:54 UTC (rev 228077)
+++ branches/safari-605-branch/Source/WebKit/ChangeLog	2018-02-05 05:30:56 UTC (rev 228078)
@@ -1,5 +1,22 @@
 2018-02-04  Jason Marcell  <jmarc...@apple.com>
 
+        Cherry-pick r228041. rdar://problem/37220123
+
+    2018-02-02  Youenn Fablet  <you...@apple.com>
+
+            CacheStorage should check for origin file presence when computing the origin of a folder
+            https://bugs.webkit.org/show_bug.cgi?id=182454
+
+            Reviewed by Chris Dumez.
+
+            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.
+            We should be checking the origin filename anyway since we will be reading it afterwards.
+
+            * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
+            (WebKit::CacheStorage::Caches::retrieveOriginFromDirectory):
+
+2018-02-04  Jason Marcell  <jmarc...@apple.com>
+
         Cherry-pick r228033. rdar://problem/37220144
 
     2018-02-02  Youenn Fablet  <you...@apple.com>

Modified: branches/safari-605-branch/Source/WebKit/NetworkProcess/cache/CacheStorageEngineCaches.cpp (228077 => 228078)


--- branches/safari-605-branch/Source/WebKit/NetworkProcess/cache/CacheStorageEngineCaches.cpp	2018-02-05 05:30:54 UTC (rev 228077)
+++ branches/safari-605-branch/Source/WebKit/NetworkProcess/cache/CacheStorageEngineCaches.cpp	2018-02-05 05:30:56 UTC (rev 228078)
@@ -57,8 +57,8 @@
 
 void Caches::retrieveOriginFromDirectory(const String& folderPath, WorkQueue& queue, WTF::CompletionHandler<void(std::optional<WebCore::ClientOrigin>&&)>&& completionHandler)
 {
-    queue.dispatch([completionHandler = WTFMove(completionHandler), folderPath = folderPath.isolatedCopy()]() mutable {
-        if (!WebCore::FileSystem::fileExists(cachesListFilename(folderPath))) {
+    queue.dispatch([completionHandler = WTFMove(completionHandler), filename = cachesOriginFilename(folderPath)]() mutable {
+        if (!WebCore::FileSystem::fileExists(filename)) {
             RunLoop::main().dispatch([completionHandler = WTFMove(completionHandler)]() mutable {
                 completionHandler(std::nullopt);
             });
@@ -65,7 +65,7 @@
             return;
         }
 
-        auto channel = IOChannel::open(cachesOriginFilename(folderPath), IOChannel::Type::Read);
+        auto channel = IOChannel::open(filename, IOChannel::Type::Read);
         channel->read(0, std::numeric_limits<size_t>::max(), nullptr, [completionHandler = WTFMove(completionHandler)](const Data& data, int error) mutable {
             ASSERT(RunLoop::isMain());
             if (error) {
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to