Bug 852467 - nsDisableOldMaxSmartSizePrefEvent runs on the gecko main thread, blocks for long periods of time, r=honzab

This commit is contained in:
Michal Novotny 2013-04-25 21:54:20 +02:00
parent cfa3b7f99b
commit 549f7cde85

View File

@ -1610,7 +1610,9 @@ public:
return rv;
}
nsCacheService::SetDiskSmartSize();
// It is safe to call SetDiskSmartSize_Locked() without holding the lock
// when we are on main thread and nsCacheService is initialized.
nsCacheService::gService->SetDiskSmartSize_Locked();
if (nsCacheService::gService->mObserver->PermittedToSmartSize(branch, false)) {
rv = branch->SetIntPref(DISK_CACHE_CAPACITY_PREF, MAX_CACHE_SIZE);