mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-27 06:43:32 +00:00
Bug 1187151 (part 2) - Replace nsBaseHashtable::Enumerate() calls in dom/base/ with iterators. r=janv.
--HG-- extra : rebase_source : 6e780bbe71aa0e2463b664ca17b9023bd9216179
This commit is contained in:
parent
9fdcc7ce00
commit
73173fb7ae
@ -2526,35 +2526,30 @@ QuotaManager::UpdateOriginAccessTime(PersistenceType aPersistenceType,
|
||||
}
|
||||
}
|
||||
|
||||
// static
|
||||
PLDHashOperator
|
||||
QuotaManager::RemoveQuotaCallback(const nsACString& aKey,
|
||||
nsAutoPtr<GroupInfoPair>& aValue,
|
||||
void* aUserArg)
|
||||
{
|
||||
NS_ASSERTION(!aKey.IsEmpty(), "Empty key!");
|
||||
NS_ASSERTION(aValue, "Null pointer!");
|
||||
|
||||
RefPtr<GroupInfo> groupInfo =
|
||||
aValue->LockedGetGroupInfo(PERSISTENCE_TYPE_TEMPORARY);
|
||||
if (groupInfo) {
|
||||
groupInfo->LockedRemoveOriginInfos();
|
||||
}
|
||||
|
||||
groupInfo = aValue->LockedGetGroupInfo(PERSISTENCE_TYPE_DEFAULT);
|
||||
if (groupInfo) {
|
||||
groupInfo->LockedRemoveOriginInfos();
|
||||
}
|
||||
|
||||
return PL_DHASH_REMOVE;
|
||||
}
|
||||
|
||||
void
|
||||
QuotaManager::RemoveQuota()
|
||||
{
|
||||
MutexAutoLock lock(mQuotaMutex);
|
||||
|
||||
mGroupInfoPairs.Enumerate(RemoveQuotaCallback, nullptr);
|
||||
for (auto iter = mGroupInfoPairs.Iter(); !iter.Done(); iter.Next()) {
|
||||
nsAutoPtr<GroupInfoPair>& pair = iter.Data();
|
||||
|
||||
MOZ_ASSERT(!iter.Key().IsEmpty(), "Empty key!");
|
||||
MOZ_ASSERT(pair, "Null pointer!");
|
||||
|
||||
RefPtr<GroupInfo> groupInfo =
|
||||
pair->LockedGetGroupInfo(PERSISTENCE_TYPE_TEMPORARY);
|
||||
if (groupInfo) {
|
||||
groupInfo->LockedRemoveOriginInfos();
|
||||
}
|
||||
|
||||
groupInfo = pair->LockedGetGroupInfo(PERSISTENCE_TYPE_DEFAULT);
|
||||
if (groupInfo) {
|
||||
groupInfo->LockedRemoveOriginInfos();
|
||||
}
|
||||
|
||||
iter.Remove();
|
||||
}
|
||||
|
||||
NS_ASSERTION(mTemporaryStorageUsage == 0, "Should be zero!");
|
||||
}
|
||||
|
@ -461,11 +461,6 @@ private:
|
||||
const nsACString& aOrigin,
|
||||
nsAutoCString& _retval);
|
||||
|
||||
static PLDHashOperator
|
||||
RemoveQuotaCallback(const nsACString& aKey,
|
||||
nsAutoPtr<GroupInfoPair>& aValue,
|
||||
void* aUserArg);
|
||||
|
||||
mozilla::Mutex mQuotaMutex;
|
||||
|
||||
nsClassHashtable<nsCStringHashKey, GroupInfoPair> mGroupInfoPairs;
|
||||
|
Loading…
Reference in New Issue
Block a user