Bug 402631 - "Need to clear all images on memory-pressure notification" [p=stuart r+aM9=vlad]

git-svn-id: svn://10.0.0.236/trunk@238572 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
reed%reedloden.com
2007-11-06 03:41:34 +00:00
parent a6657a876e
commit 244b8c40a8

View File

@@ -346,10 +346,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);
ClearCache(PR_TRUE);
} else if (strcmp(aTopic, "chrome-flush-skin-caches") == 0 ||
strcmp(aTopic, "chrome-flush-caches") == 0) {
ClearCache(PR_TRUE);
}
return NS_OK;
}