Regression (r232410): StorageTracker.db file gets unlinked while in use
authorsihui_liu@apple.com <sihui_liu@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 22 Oct 2018 21:05:20 +0000 (21:05 +0000)
committersihui_liu@apple.com <sihui_liu@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 22 Oct 2018 21:05:20 +0000 (21:05 +0000)
https://bugs.webkit.org/show_bug.cgi?id=190795

Reviewed by Chris Dumez.

WK2 stopped using StorageTracker.db file in r232410 and would delete
the file for safety.
It turned out WK1 could use the same file path, so WK2 may delete the
file while WK1 is using it.

* Storage/StorageTracker.cpp:
(WebKit::StorageTracker::trackerDatabasePath):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@237330 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebKitLegacy/ChangeLog
Source/WebKitLegacy/Storage/StorageTracker.cpp

index 8beaa94..e3fdd71 100644 (file)
@@ -1,3 +1,18 @@
+2018-10-22  Sihui Liu  <sihui_liu@apple.com>
+
+        Regression (r232410): StorageTracker.db file gets unlinked while in use
+        https://bugs.webkit.org/show_bug.cgi?id=190795
+
+        Reviewed by Chris Dumez.
+
+        WK2 stopped using StorageTracker.db file in r232410 and would delete 
+        the file for safety.
+        It turned out WK1 could use the same file path, so WK2 may delete the 
+        file while WK1 is using it.
+
+        * Storage/StorageTracker.cpp:
+        (WebKit::StorageTracker::trackerDatabasePath):
+
 2018-10-18  Alexey Proskuryakov  <ap@apple.com>
 
         Switch from PLATFORM(IOS) to PLATFORM(IOS_FAMILY)
index 8349047..81d2a43 100644 (file)
@@ -104,7 +104,7 @@ StorageTracker::StorageTracker(const String& storagePath)
 String StorageTracker::trackerDatabasePath()
 {
     ASSERT(!m_databaseMutex.tryLock());
-    return FileSystem::pathByAppendingComponent(m_storageDirectoryPath, "StorageTracker.db");
+    return FileSystem::pathByAppendingComponent(m_storageDirectoryPath, "LegacyStorageTracker.db");
 }
 
 static bool ensureDatabaseFileExists(const String& fileName, bool createIfDoesNotExist)