mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1187152 (part 1) - Replace nsBaseHashtable::Enumerate() calls in modules/ with iterators. r=mwu.
This commit is contained in:
parent
f01997aef8
commit
d71cb426cd
@ -1331,16 +1331,6 @@ nsZipReaderCache::ReleaseZip(nsJAR* zip)
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
static PLDHashOperator
|
||||
FindFlushableZip(const nsACString &aKey, RefPtr<nsJAR>& aCurrent, void*)
|
||||
{
|
||||
if (aCurrent->GetReleaseTime() != PR_INTERVAL_NO_TIMEOUT) {
|
||||
aCurrent->SetZipReaderCache(nullptr);
|
||||
return PL_DHASH_REMOVE;
|
||||
}
|
||||
return PL_DHASH_NEXT;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsZipReaderCache::Observe(nsISupports *aSubject,
|
||||
const char *aTopic,
|
||||
@ -1348,7 +1338,13 @@ nsZipReaderCache::Observe(nsISupports *aSubject,
|
||||
{
|
||||
if (strcmp(aTopic, "memory-pressure") == 0) {
|
||||
MutexAutoLock lock(mLock);
|
||||
mZips.Enumerate(FindFlushableZip, nullptr);
|
||||
for (auto iter = mZips.Iter(); !iter.Done(); iter.Next()) {
|
||||
RefPtr<nsJAR>& current = iter.Data();
|
||||
if (current->GetReleaseTime() != PR_INTERVAL_NO_TIMEOUT) {
|
||||
current->SetZipReaderCache(nullptr);
|
||||
iter.Remove();
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (strcmp(aTopic, "chrome-flush-caches") == 0) {
|
||||
MutexAutoLock lock(mLock);
|
||||
|
Loading…
Reference in New Issue
Block a user