зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1562305 - Make browser.cache.memory.enable a static pref. r=michal
Differential Revision: https://phabricator.services.mozilla.com/D37178 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
17b83b6b8b
Коммит
dcb65203e0
|
@ -70,7 +70,6 @@ pref("ui.caretBlinkCount", 10);
|
|||
/* cache prefs */
|
||||
pref("browser.cache.disk.smart_size.enabled", true);
|
||||
|
||||
pref("browser.cache.memory.enable", true);
|
||||
pref("browser.cache.memory.capacity", 1024); // kilobytes
|
||||
|
||||
pref("browser.cache.memory_limit", 5120); // 5 MB
|
||||
|
|
|
@ -719,6 +719,13 @@ VARCACHE_PREF(
|
|||
RelaxedAtomicBool, true
|
||||
)
|
||||
|
||||
VARCACHE_PREF(
|
||||
Live,
|
||||
"browser.cache.memory.enable",
|
||||
browser_cache_memory_enable,
|
||||
RelaxedAtomicBool, true
|
||||
)
|
||||
|
||||
// Whether Content Blocking Third-Party Cookies UI has been enabled.
|
||||
VARCACHE_PREF(
|
||||
Live,
|
||||
|
|
|
@ -43,7 +43,6 @@ pref("browser.cache.disk.free_space_hard_limit", 1024); // 1MB
|
|||
// Max-size (in KB) for entries in disk cache. Set to -1 for no limit.
|
||||
// (Note: entries bigger than 1/8 of disk-cache are never cached)
|
||||
pref("browser.cache.disk.max_entry_size", 51200); // 50 MB
|
||||
pref("browser.cache.memory.enable", true);
|
||||
// -1 = determine dynamically, 0 = none, n = memory capacity in kilobytes
|
||||
//pref("browser.cache.memory.capacity", -1);
|
||||
// Max-size (in KB) for entries in memory cache. Set to -1 for no limit.
|
||||
|
|
|
@ -26,9 +26,6 @@ StaticRefPtr<CacheObserver> CacheObserver::sSelf;
|
|||
static float const kDefaultHalfLifeHours = 24.0F; // 24 hours
|
||||
float CacheObserver::sHalfLifeHours = kDefaultHalfLifeHours;
|
||||
|
||||
static bool const kDefaultUseMemoryCache = true;
|
||||
bool CacheObserver::sUseMemoryCache = kDefaultUseMemoryCache;
|
||||
|
||||
static uint32_t const kDefaultMetadataMemoryLimit = 250; // 0.25 MB
|
||||
uint32_t CacheObserver::sMetadataMemoryLimit = kDefaultMetadataMemoryLimit;
|
||||
|
||||
|
@ -143,9 +140,6 @@ nsresult CacheObserver::Shutdown() {
|
|||
}
|
||||
|
||||
void CacheObserver::AttachToPreferences() {
|
||||
mozilla::Preferences::AddBoolVarCache(
|
||||
&sUseMemoryCache, "browser.cache.memory.enable", kDefaultUseMemoryCache);
|
||||
|
||||
mozilla::Preferences::AddUintVarCache(
|
||||
&sMetadataMemoryLimit, "browser.cache.disk.metadata_memory_limit",
|
||||
kDefaultMetadataMemoryLimit);
|
||||
|
|
|
@ -29,7 +29,9 @@ class CacheObserver : public nsIObserver, public nsSupportsWeakReference {
|
|||
static bool UseDiskCache() {
|
||||
return StaticPrefs::browser_cache_disk_enable();
|
||||
}
|
||||
static bool UseMemoryCache() { return sUseMemoryCache; }
|
||||
static bool UseMemoryCache() {
|
||||
return StaticPrefs::browser_cache_memory_enable();
|
||||
}
|
||||
static uint32_t MetadataMemoryLimit() // result in kilobytes.
|
||||
{
|
||||
return sMetadataMemoryLimit;
|
||||
|
@ -101,7 +103,6 @@ class CacheObserver : public nsIObserver, public nsSupportsWeakReference {
|
|||
void StoreCacheAmountWritten();
|
||||
void AttachToPreferences();
|
||||
|
||||
static bool sUseMemoryCache;
|
||||
static uint32_t sMetadataMemoryLimit;
|
||||
static int32_t sMemoryCacheCapacity;
|
||||
static int32_t sAutoMemoryCacheCapacity;
|
||||
|
|
Загрузка…
Ссылка в новой задаче