Title: [227331] branches/safari-605-branch/Source/WebKit
Revision
227331
Author
jmarc...@apple.com
Date
2018-01-22 09:58:42 -0800 (Mon, 22 Jan 2018)

Log Message

Cherry-pick r227269. rdar://problem/36722433

Modified Paths

Diff

Modified: branches/safari-605-branch/Source/WebKit/ChangeLog (227330 => 227331)


--- branches/safari-605-branch/Source/WebKit/ChangeLog	2018-01-22 17:58:40 UTC (rev 227330)
+++ branches/safari-605-branch/Source/WebKit/ChangeLog	2018-01-22 17:58:42 UTC (rev 227331)
@@ -1,5 +1,28 @@
 2018-01-22  Jason Marcell  <jmarc...@apple.com>
 
+        Cherry-pick r227269. rdar://problem/36722433
+
+    2018-01-20  Chris Dumez  <cdu...@apple.com>
+
+            DOMCache data sometimes not properly removed when clearing data for a given origin
+            https://bugs.webkit.org/show_bug.cgi?id=181887
+            <rdar://problem/36671239>
+
+            Reviewed by Youenn Fablet.
+
+            * NetworkProcess/cache/CacheStorageEngine.cpp:
+            (WebKit::CacheStorage::Engine::clearCachesForOrigin):
+            This code was iterating through folders on disk, then reading the folder's origin
+            from the origin file on disk. Then, if the origin would match the one we want to
+            delete, it would regenerate the folder path using cachesRootPath(*folderOrigin).
+            I don't know how but on my machine, I was ended up in a state where the path
+            generated by cachesRootPath(*folderOrigin) differed from the actual folder path
+            we read the origin from (Likely a different salt?). To make the code more robust,
+            I updated the code to delete "folderPath", which is the path we read the origin
+            from.
+
+2018-01-22  Jason Marcell  <jmarc...@apple.com>
+
         Cherry-pick r227242. rdar://problem/36722539
 
     2018-01-19  Youenn Fablet  <you...@apple.com>

Modified: branches/safari-605-branch/Source/WebKit/NetworkProcess/cache/CacheStorageEngine.cpp (227330 => 227331)


--- branches/safari-605-branch/Source/WebKit/NetworkProcess/cache/CacheStorageEngine.cpp	2018-01-22 17:58:40 UTC (rev 227330)
+++ branches/safari-605-branch/Source/WebKit/NetworkProcess/cache/CacheStorageEngine.cpp	2018-01-22 17:58:42 UTC (rev 227331)
@@ -414,13 +414,13 @@
     for (auto& folderPath : WebCore::FileSystem::listDirectory(m_rootPath, "*")) {
         if (!WebCore::FileSystem::fileIsDirectory(folderPath, WebCore::FileSystem::ShouldFollowSymbolicLinks::No))
             continue;
-        Caches::retrieveOriginFromDirectory(folderPath, *m_ioQueue, [this, protectedThis = makeRef(*this), origin, taskHandler = makeRef(taskHandler)] (std::optional<WebCore::ClientOrigin>&& folderOrigin) mutable {
+        Caches::retrieveOriginFromDirectory(folderPath, *m_ioQueue, [this, protectedThis = makeRef(*this), origin, taskHandler = makeRef(taskHandler), folderPath] (std::optional<WebCore::ClientOrigin>&& folderOrigin) mutable {
             if (!folderOrigin)
                 return;
             if (folderOrigin->topOrigin != origin && folderOrigin->clientOrigin != origin)
                 return;
 
-            m_ioQueue->dispatch([path = cachesRootPath(*folderOrigin), taskHandler = WTFMove(taskHandler)] {
+            m_ioQueue->dispatch([path = folderPath.isolatedCopy(), taskHandler = WTFMove(taskHandler)] {
                 deleteDirectoryRecursively(path);
             });
         });
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to