Title: [228041] trunk/Source/WebKit
Revision
228041
Author
commit-qu...@webkit.org
Date
2018-02-02 18:05:54 -0800 (Fri, 02 Feb 2018)

Log Message

CacheStorage should check for origin file presence when computing the origin of a folder
https://bugs.webkit.org/show_bug.cgi?id=182454

Patch by Youenn Fablet <you...@apple.com> on 2018-02-02
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):

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (228040 => 228041)


--- trunk/Source/WebKit/ChangeLog	2018-02-03 01:39:14 UTC (rev 228040)
+++ trunk/Source/WebKit/ChangeLog	2018-02-03 02:05:54 UTC (rev 228041)
@@ -1,5 +1,18 @@
 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-02  Youenn Fablet  <you...@apple.com>
+
         Configure serviceWorkerRegistrationDirectory on the web site data store and move it to a Caches subfolder as a default
         https://bugs.webkit.org/show_bug.cgi?id=182403
         <rdar://problem/36673358>

Modified: trunk/Source/WebKit/NetworkProcess/cache/CacheStorageEngineCaches.cpp (228040 => 228041)


--- trunk/Source/WebKit/NetworkProcess/cache/CacheStorageEngineCaches.cpp	2018-02-03 01:39:14 UTC (rev 228040)
+++ trunk/Source/WebKit/NetworkProcess/cache/CacheStorageEngineCaches.cpp	2018-02-03 02:05:54 UTC (rev 228041)
@@ -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