ERROR: ResourceLoadStatisticsPersistentStorage: Unable to delete statistics file
authorcsaavedra@igalia.com <csaavedra@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 1 Nov 2018 16:40:15 +0000 (16:40 +0000)
committercsaavedra@igalia.com <csaavedra@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 1 Nov 2018 16:40:15 +0000 (16:40 +0000)
https://bugs.webkit.org/show_bug.cgi?id=191152

Reviewed by Chris Dumez.

The statistics file is not created unconditionally, so
make sure it exists before logging an error.

* UIProcess/ResourceLoadStatisticsPersistentStorage.cpp:
(WebKit::ResourceLoadStatisticsPersistentStorage::clear):
Check that the file exists before logging an error.

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

Source/WebKit/ChangeLog
Source/WebKit/UIProcess/ResourceLoadStatisticsPersistentStorage.cpp

index 85d5dc4..d754b29 100644 (file)
@@ -1,5 +1,19 @@
 2018-11-01  Claudio Saavedra  <csaavedra@igalia.com>
 
+        ERROR: ResourceLoadStatisticsPersistentStorage: Unable to delete statistics file
+        https://bugs.webkit.org/show_bug.cgi?id=191152
+
+        Reviewed by Chris Dumez.
+
+        The statistics file is not created unconditionally, so
+        make sure it exists before logging an error.
+
+        * UIProcess/ResourceLoadStatisticsPersistentStorage.cpp:
+        (WebKit::ResourceLoadStatisticsPersistentStorage::clear):
+        Check that the file exists before logging an error.
+
+2018-11-01  Claudio Saavedra  <csaavedra@igalia.com>
+
         [GLIB] Silent a build warning when not using Wayland
 
         Unreviewed.
index 0b926d5..6f85d36 100644 (file)
@@ -307,7 +307,7 @@ void ResourceLoadStatisticsPersistentStorage::clear()
 
     stopMonitoringDisk();
 
-    if (!FileSystem::deleteFile(filePath))
+    if (!FileSystem::deleteFile(filePath) && FileSystem::fileExists(filePath))
         RELEASE_LOG_ERROR(ResourceLoadStatistics, "ResourceLoadStatisticsPersistentStorage: Unable to delete statistics file: %s", filePath.utf8().data());
 }