Bug 1895978 - Add the new clear on shutdown cache pref to the cache purging task code. r=pbz,necko-reviewers,valentin

Differential Revision: https://phabricator.services.mozilla.com/D210681
This commit is contained in:
Harshit Sohaney 2024-05-25 15:19:14 +00:00
Родитель 17372d5f6f
Коммит ffbc69a780
2 изменённых файлов: 18 добавлений и 2 удалений

Просмотреть файл

@ -14217,6 +14217,11 @@
value: 1000
mirror: always
- name: privacy.sanitize.useOldClearHistoryDialog
type: RelaxedAtomicBool
value: true
mirror: always
- name: privacy.sanitize.sanitizeOnShutdown
type: RelaxedAtomicBool
value: false
@ -14227,6 +14232,11 @@
value: false
mirror: always
- name: privacy.clearOnShutdown_v2.cache
type: RelaxedAtomicBool
value: false
mirror: always
- name: privacy.dynamic_firstparty.limitForeign
type: RelaxedAtomicBool
value: false

Просмотреть файл

@ -73,8 +73,14 @@ class CacheObserver : public nsIObserver, public nsSupportsWeakReference {
}
static uint32_t HalfLifeSeconds() { return sHalfLifeHours * 60.0F * 60.0F; }
static bool ClearCacheOnShutdown() {
return StaticPrefs::privacy_sanitize_sanitizeOnShutdown() &&
StaticPrefs::privacy_clearOnShutdown_cache();
if (!StaticPrefs::privacy_sanitize_sanitizeOnShutdown()) {
return false;
}
if (StaticPrefs::privacy_sanitize_useOldClearHistoryDialog()) {
return StaticPrefs::privacy_clearOnShutdown_cache();
}
// use the new cache clearing pref for the new clear history dialog
return StaticPrefs::privacy_clearOnShutdown_v2_cache();
}
static void ParentDirOverride(nsIFile** aDir);