Bug 1247432 - Don't do any unnecessary I/O in cache2 after shutdown. r=michal

This commit is contained in:
Honza Bambas 2016-02-12 09:36:00 -05:00
Родитель 0acb222f9a
Коммит fd14c17712
1 изменённых файлов: 7 добавлений и 11 удалений

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

@ -503,18 +503,13 @@ CacheObserver::Observe(nsISupports* aSubject,
return NS_OK;
}
if (!strcmp(aTopic, "profile-before-change")) {
if (!strcmp(aTopic, "profile-change-net-teardown") ||
!strcmp(aTopic, "profile-before-change") ||
!strcmp(aTopic, "xpcom-shutdown")) {
RefPtr<CacheStorageService> service = CacheStorageService::Self();
if (service)
service->Shutdown();
return NS_OK;
}
if (!strcmp(aTopic, "xpcom-shutdown")) {
RefPtr<CacheStorageService> service = CacheStorageService::Self();
if (service)
if (service) {
service->Shutdown();
}
CacheFileIOManager::Shutdown();
return NS_OK;
@ -522,8 +517,9 @@ CacheObserver::Observe(nsISupports* aSubject,
if (!strcmp(aTopic, "last-pb-context-exited")) {
RefPtr<CacheStorageService> service = CacheStorageService::Self();
if (service)
if (service) {
service->DropPrivateBrowsingEntries();
}
return NS_OK;
}