Bug 967693 - Temporarily turn on HTTP cache v2, alternative pref to not lose early adopters, r=jduell

This commit is contained in:
Honza Bambas 2014-02-05 23:36:56 +01:00
parent 2af12fb550
commit cdac679592
2 changed files with 12 additions and 2 deletions

View File

@ -1364,4 +1364,4 @@ pref("identity.fxaccounts.auth.uri", "https://api.accounts.firefox.com/v1");
// Temporarily turn the new http cache v2 on for Desktop Firefox only
pref("browser.cache.use_new_backend", 1);
pref("browser.cache.use_new_backend_temp", true);

View File

@ -25,6 +25,9 @@ uint32_t CacheObserver::sMemoryLimit = kDefaultMemoryLimit;
static uint32_t const kDefaultUseNewCache = 0; // Don't use the new cache by default
uint32_t CacheObserver::sUseNewCache = kDefaultUseNewCache;
static bool sUseNewCacheTemp = false; // Temp trigger to not lose early adopters
static int32_t const kAutoDeleteCacheVersion = -1; // Auto-delete off by default
static int32_t sAutoDeleteCacheVersion = kAutoDeleteCacheVersion;
@ -102,6 +105,8 @@ CacheObserver::AttachToPreferences()
mozilla::Preferences::AddUintVarCache(
&sUseNewCache, "browser.cache.use_new_backend", kDefaultUseNewCache);
mozilla::Preferences::AddBoolVarCache(
&sUseNewCacheTemp, "browser.cache.use_new_backend_temp", false);
mozilla::Preferences::AddBoolVarCache(
&sUseDiskCache, "browser.cache.disk.enable", kDefaultUseDiskCache);
@ -177,7 +182,12 @@ void CacheObserver::SchduleAutoDelete()
// static
bool const CacheObserver::UseNewCache()
{
switch (sUseNewCache) {
uint32_t useNewCache = sUseNewCache;
if (sUseNewCacheTemp)
useNewCache = 1;
switch (useNewCache) {
case 0: // use the old cache backend
return false;