Modified: branches/safari-604-branch/Source/WebKit/ChangeLog (220017 => 220018)
--- branches/safari-604-branch/Source/WebKit/ChangeLog 2017-07-28 22:04:02 UTC (rev 220017)
+++ branches/safari-604-branch/Source/WebKit/ChangeLog 2017-07-28 22:19:34 UTC (rev 220018)
@@ -1,3 +1,25 @@
+2017-07-28 Jason Marcell <[email protected]>
+
+ Cherry-pick r219855. rdar://problem/33595427
+
+ 2017-07-24 Chris Dumez <[email protected]>
+
+ [WK2][Cocoa] Allow overriding the ITP data removal internal using a default
+ https://bugs.webkit.org/show_bug.cgi?id=174802
+ <rdar://problem/33497898>
+
+ Reviewed by Sam Weinig.
+
+ Allow overriding the ITP data removal internal using a default to facilitate testing.
+ Can be used like so:
+ defaults write -g ResourceLoadStatisticsMinimumTimeBetweenDataRecordsRemoval 60
+
+ Will cause us to write every 60 seconds instead of 3600.
+
+ * Shared/WebPreferencesDefinitions.h:
+ * UIProcess/Cocoa/WebResourceLoadStatisticsStoreCocoa.mm:
+ (WebKit::WebResourceLoadStatisticsStore::registerUserDefaultsIfNeeded):
+
2017-07-26 Jason Marcell <[email protected]>
Cherry-pick r219876. rdar://problem/33523847
Modified: branches/safari-604-branch/Source/WebKit/Shared/WebPreferencesDefinitions.h (220017 => 220018)
--- branches/safari-604-branch/Source/WebKit/Shared/WebPreferencesDefinitions.h 2017-07-28 22:04:02 UTC (rev 220017)
+++ branches/safari-604-branch/Source/WebKit/Shared/WebPreferencesDefinitions.h 2017-07-28 22:19:34 UTC (rev 220018)
@@ -304,10 +304,6 @@
macro(LayoutInterval, layoutInterval, Double, double, -1, "", "") \
macro(MaxParseDuration, maxParseDuration, Double, double, -1, "", "") \
macro(PasswordEchoDuration, passwordEchoDuration, Double, double, 2, "", "") \
- macro(ResourceLoadStatisticsTimeToLiveUserInteraction, resourceLoadStatisticsTimeToLiveUserInteraction, Double, double, 2592000, "", "") \
- macro(ResourceLoadStatisticsTimeToLiveCookiePartitionFree, resourceLoadStatisticsTimeToLiveCookiePartitionFree, Double, double, 86400, "", "") \
- macro(ResourceLoadStatisticsReducedTimestampResolution, resourceLoadStatisticsReducedTimestampResolution, Double, double, 3600, "", "") \
- macro(ResourceLoadStatisticsGrandfatheringTime, resourceLoadStatisticsGrandfatheringTime, Double, double, 3600, "", "") \
\
#define FOR_EACH_WEBKIT_UINT32_PREFERENCE(macro) \
Modified: branches/safari-604-branch/Source/WebKit/UIProcess/Cocoa/WebResourceLoadStatisticsStoreCocoa.mm (220017 => 220018)
--- branches/safari-604-branch/Source/WebKit/UIProcess/Cocoa/WebResourceLoadStatisticsStoreCocoa.mm 2017-07-28 22:04:02 UTC (rev 220017)
+++ branches/safari-604-branch/Source/WebKit/UIProcess/Cocoa/WebResourceLoadStatisticsStoreCocoa.mm 2017-07-28 22:19:34 UTC (rev 220018)
@@ -26,10 +26,6 @@
#include "config.h"
#import "WebResourceLoadStatisticsStore.h"
-#import "WebPreferencesKeys.h"
-
-using namespace WebCore;
-
namespace WebKit {
void WebResourceLoadStatisticsStore::registerUserDefaultsIfNeeded()
@@ -37,20 +33,21 @@
static dispatch_once_t initOnce;
dispatch_once(&initOnce, ^ {
- const size_t hourInSeconds = 3600;
- const size_t dayInSeconds = 24 * hourInSeconds;
+ Seconds timeToLiveUserInteraction([[NSUserDefaults standardUserDefaults] doubleForKey:@"ResourceLoadStatisticsTimeToLiveUserInteraction"]);
+ if (timeToLiveUserInteraction > 0_s && timeToLiveUserInteraction <= 24_h * 30)
+ setTimeToLiveUserInteraction(timeToLiveUserInteraction);
- double timeToLiveUserInteraction = [[NSUserDefaults standardUserDefaults] doubleForKey: WebPreferencesKey::resourceLoadStatisticsTimeToLiveUserInteractionKey()];
- if (timeToLiveUserInteraction > 0 && timeToLiveUserInteraction <= 30 * dayInSeconds)
- setTimeToLiveUserInteraction(Seconds { timeToLiveUserInteraction });
+ Seconds timeToLiveCookiePartitionFree([[NSUserDefaults standardUserDefaults] doubleForKey:@"ResourceLoadStatisticsTimeToLiveCookiePartitionFree"]);
+ if (timeToLiveCookiePartitionFree > 0_s && timeToLiveCookiePartitionFree <= 24_h)
+ setTimeToLiveCookiePartitionFree(timeToLiveCookiePartitionFree);
- double timeToLiveCookiePartitionFree = [[NSUserDefaults standardUserDefaults] doubleForKey: WebPreferencesKey::resourceLoadStatisticsTimeToLiveCookiePartitionFreeKey()];
- if (timeToLiveCookiePartitionFree > 0 && timeToLiveCookiePartitionFree <= dayInSeconds)
- setTimeToLiveCookiePartitionFree(Seconds { timeToLiveCookiePartitionFree });
+ Seconds minimumTimeBetweenDataRecordsRemoval([[NSUserDefaults standardUserDefaults] doubleForKey:@"ResourceLoadStatisticsMinimumTimeBetweenDataRecordsRemoval"]);
+ if (minimumTimeBetweenDataRecordsRemoval > 0_s && minimumTimeBetweenDataRecordsRemoval < 1_h)
+ setMinimumTimeBetweenDataRecordsRemoval(minimumTimeBetweenDataRecordsRemoval);
- double grandfatheringTime = [[NSUserDefaults standardUserDefaults] doubleForKey: WebPreferencesKey::resourceLoadStatisticsGrandfatheringTimeKey()];
- if (grandfatheringTime > 0 && grandfatheringTime <= 7 * dayInSeconds)
- setGrandfatheringTime(Seconds { grandfatheringTime });
+ Seconds grandfatheringTime([[NSUserDefaults standardUserDefaults] doubleForKey:@"ResourceLoadStatisticsGrandfatheringTime"]);
+ if (grandfatheringTime > 0_s && grandfatheringTime <= 24_h * 7)
+ setGrandfatheringTime(grandfatheringTime);
});
}