Title: [254501] trunk/Source/WebKit
Revision
254501
Author
you...@apple.com
Date
2020-01-14 01:17:46 -0800 (Tue, 14 Jan 2020)

Log Message

CacheStorage::Engine::clearCachesForOriginFromDisk ASSERT is buggy
https://bugs.webkit.org/show_bug.cgi?id=206057
<rdar://problem/57762994>

Reviewed by John Wilander.

The ASSERT is only valid if the engine is initialized.
It is not needed to initialize it if the plan is to remove all disk files.
Instead, update ASSERT to check that either m_salt is not there or the salt is there and the path is as expected.

* NetworkProcess/cache/CacheStorageEngine.cpp:
(WebKit::CacheStorage::Engine::clearCachesForOriginFromDirectories):

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (254500 => 254501)


--- trunk/Source/WebKit/ChangeLog	2020-01-14 08:40:50 UTC (rev 254500)
+++ trunk/Source/WebKit/ChangeLog	2020-01-14 09:17:46 UTC (rev 254501)
@@ -1,3 +1,18 @@
+2020-01-14  youenn fablet  <you...@apple.com>
+
+        CacheStorage::Engine::clearCachesForOriginFromDisk ASSERT is buggy
+        https://bugs.webkit.org/show_bug.cgi?id=206057
+        <rdar://problem/57762994>
+
+        Reviewed by John Wilander.
+
+        The ASSERT is only valid if the engine is initialized.
+        It is not needed to initialize it if the plan is to remove all disk files.
+        Instead, update ASSERT to check that either m_salt is not there or the salt is there and the path is as expected.
+
+        * NetworkProcess/cache/CacheStorageEngine.cpp:
+        (WebKit::CacheStorage::Engine::clearCachesForOriginFromDirectories):
+
 2020-01-14  Eric Carlson  <eric.carl...@apple.com>
 
         Expose video tracks for media files in the GPUProcess

Modified: trunk/Source/WebKit/NetworkProcess/cache/CacheStorageEngine.cpp (254500 => 254501)


--- trunk/Source/WebKit/NetworkProcess/cache/CacheStorageEngine.cpp	2020-01-14 08:40:50 UTC (rev 254500)
+++ trunk/Source/WebKit/NetworkProcess/cache/CacheStorageEngine.cpp	2020-01-14 09:17:46 UTC (rev 254501)
@@ -744,7 +744,8 @@
             if (folderOrigin->topOrigin != origin && folderOrigin->clientOrigin != origin)
                 return;
 
-            ASSERT(folderPath == cachesRootPath(*folderOrigin));
+            // If cache salt is initialized and the paths do not match, some cache files have probably be removed or partially corrupted.
+            ASSERT(!m_salt || folderPath == cachesRootPath(*folderOrigin));
             deleteDirectoryRecursivelyOnBackgroundThread(folderPath, [callbackAggregator = WTFMove(callbackAggregator)] { });
         });
     }
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to