Bug 268798. fixes not flushing session cache during a memory-pressure notification. r=pavlov, sr=dbaron, a=benjamin

This commit is contained in:
dougt%meer.net 2005-07-26 15:00:20 +00:00
parent cb1033c179
commit 8d1d39bf6c

View File

@ -344,10 +344,12 @@ PRBool imgCache::Remove(nsIURI *aKey)
NS_IMETHODIMP
imgCache::Observe(nsISupports* aSubject, const char* aTopic, const PRUnichar* aSomeData)
{
if (strcmp(aTopic, "memory-pressure") == 0 ||
strcmp(aTopic, "chrome-flush-skin-caches") == 0 ||
strcmp(aTopic, "chrome-flush-caches") == 0)
if (strcmp(aTopic, "memory-pressure") == 0) {
ClearCache(PR_FALSE);
}
else if (strcmp(aTopic, "chrome-flush-skin-caches") == 0 ||
strcmp(aTopic, "chrome-flush-caches") == 0) {
ClearCache(PR_TRUE);
}
return NS_OK;
}