Bug 1045886 - Remove Cache directory from Android profiles r=michal

This commit is contained in:
Valentin Gosu 2014-08-12 12:04:13 +03:00
parent 9bb67b6622
commit 01e9603ddb
4 changed files with 5 additions and 4 deletions

View File

@ -1683,8 +1683,6 @@ pref("media.gmp-manager.certs.1.commonName", "aus4.mozilla.org");
pref("media.gmp-manager.certs.2.issuerName", "CN=Thawte SSL CA,O=\"Thawte, Inc.\",C=US");
pref("media.gmp-manager.certs.2.commonName", "aus4.mozilla.org");
// Delete HTTP cache v2 data of users that didn't opt-in manually
pref("browser.cache.auto_delete_cache_version", 1);
// Play with different values of the decay time and get telemetry,
// 0 means to randomize (and persist) the experiment value in users' profiles,
// -1 means no experiment is run and we use the preferred value for frecency (6h)

View File

@ -34,6 +34,8 @@ pref("general.warnOnAboutConfig", true);
// maximum number of dated backups to keep at any time
pref("browser.bookmarks.max_backups", 5);
// Delete HTTP cache v1 data
pref("browser.cache.auto_delete_cache_version", 0);
// Preference for switching the cache backend, can be changed freely at runtime
// 0 - use the old (Darin's) cache
// 1 - use the new cache back-end (cache v2)

View File

@ -108,7 +108,7 @@ CacheObserver::Init()
obs->AddObserver(sSelf, "prefservice:after-app-defaults", true);
obs->AddObserver(sSelf, "profile-do-change", true);
obs->AddObserver(sSelf, "sessionstore-windows-restored", true);
obs->AddObserver(sSelf, "browser-delayed-startup-finished", true);
obs->AddObserver(sSelf, "profile-before-change", true);
obs->AddObserver(sSelf, "xpcom-shutdown", true);
obs->AddObserver(sSelf, "last-pb-context-exited", true);
@ -450,7 +450,7 @@ CacheObserver::Observe(nsISupports* aSubject,
return NS_OK;
}
if (!strcmp(aTopic, "sessionstore-windows-restored")) {
if (!strcmp(aTopic, "browser-delayed-startup-finished")) {
uint32_t activeVersion = UseNewCache() ? 1 : 0;
CacheStorageService::CleaupCacheDirectories(sAutoDeleteCacheVersion, activeVersion);
return NS_OK;

View File

@ -594,6 +594,7 @@ NS_IMETHODIMP CleaupCacheDirectoriesRunnable::Run()
}
#if defined(MOZ_WIDGET_ANDROID)
if (mCache2Profileless) {
nsDeleteDir::RemoveOldTrashes(mCache2Profileless);
// Always delete the profileless cache on Android
nsDeleteDir::DeleteDir(mCache2Profileless, true, 30000);
}