Resource Load Statistics: Revert defaults read of zero values
authorwilander@apple.com <wilander@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 8 Mar 2018 21:35:38 +0000 (21:35 +0000)
committerwilander@apple.com <wilander@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 8 Mar 2018 21:35:38 +0000 (21:35 +0000)
https://bugs.webkit.org/show_bug.cgi?id=183476

Unreviewed revert of three small changes landed in r229427.

* UIProcess/Cocoa/WebResourceLoadStatisticsStoreCocoa.mm:
(WebKit::WebResourceLoadStatisticsStore::registerUserDefaultsIfNeeded):
    Reverted back to strict check of greater than zero for defaults reads.

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

Source/WebKit/ChangeLog
Source/WebKit/UIProcess/Cocoa/WebResourceLoadStatisticsStoreCocoa.mm

index c646590..2471763 100644 (file)
@@ -1,3 +1,14 @@
+2018-03-08  John Wilander  <wilander@apple.com>
+
+        Resource Load Statistics: Revert defaults read of zero values
+        https://bugs.webkit.org/show_bug.cgi?id=183476
+
+        Unreviewed revert of three small changes landed in r229427.
+
+        * UIProcess/Cocoa/WebResourceLoadStatisticsStoreCocoa.mm:
+        (WebKit::WebResourceLoadStatisticsStore::registerUserDefaultsIfNeeded):
+            Reverted back to strict check of greater than zero for defaults reads.
+
 2018-03-08  Tim Horton  <timothy_horton@apple.com>
 
         Don't have SafariServices in minimal simulator build
index 171a8c2..20faf9f 100644 (file)
@@ -38,15 +38,15 @@ void WebResourceLoadStatisticsStore::registerUserDefaultsIfNeeded()
             setTimeToLiveUserInteraction(timeToLiveUserInteraction);
 
         Seconds timeToLiveCookiePartitionFree([[NSUserDefaults standardUserDefaults] doubleForKey:@"ResourceLoadStatisticsTimeToLiveCookiePartitionFree"]);
-        if (timeToLiveCookiePartitionFree >= 0_s && timeToLiveCookiePartitionFree <= 24_h)
+        if (timeToLiveCookiePartitionFree > 0_s && timeToLiveCookiePartitionFree <= 24_h)
             setTimeToLiveCookiePartitionFree(timeToLiveCookiePartitionFree);
 
         Seconds minimumTimeBetweenDataRecordsRemoval([[NSUserDefaults standardUserDefaults] doubleForKey:@"ResourceLoadStatisticsMinimumTimeBetweenDataRecordsRemoval"]);
-        if (minimumTimeBetweenDataRecordsRemoval >= 0_s && minimumTimeBetweenDataRecordsRemoval < 1_h)
+        if (minimumTimeBetweenDataRecordsRemoval > 0_s && minimumTimeBetweenDataRecordsRemoval < 1_h)
             setMinimumTimeBetweenDataRecordsRemoval(minimumTimeBetweenDataRecordsRemoval);
 
         Seconds grandfatheringTime([[NSUserDefaults standardUserDefaults] doubleForKey:@"ResourceLoadStatisticsGrandfatheringTime"]);
-        if (grandfatheringTime >= 0_s && grandfatheringTime <= 24_h * 7)
+        if (grandfatheringTime > 0_s && grandfatheringTime <= 24_h * 7)
             setGrandfatheringTime(grandfatheringTime);
 
         setDebugLogggingEnabled([[NSUserDefaults standardUserDefaults] boolForKey:@"ResourceLoadStatisticsDebugLoggingEnabled"]);