mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1187151 (part 5) - Replace nsBaseHashtable::Enumerate() calls in dom/ with iterators. r=khuey.
This commit is contained in:
parent
3ec085d50c
commit
a6ee9f76d6
@ -15895,22 +15895,6 @@ FileManager::Init(nsIFile* aDirectory,
|
||||
nsresult
|
||||
FileManager::Invalidate()
|
||||
{
|
||||
class MOZ_STACK_CLASS Helper final
|
||||
{
|
||||
public:
|
||||
static PLDHashOperator
|
||||
ClearDBRefs(const uint64_t& aKey, FileInfo*& aValue, void* aUserArg)
|
||||
{
|
||||
MOZ_ASSERT(aValue);
|
||||
|
||||
if (aValue->LockedClearDBRefs()) {
|
||||
return PL_DHASH_NEXT;
|
||||
}
|
||||
|
||||
return PL_DHASH_REMOVE;
|
||||
}
|
||||
};
|
||||
|
||||
if (IndexedDatabaseManager::IsClosed()) {
|
||||
MOZ_ASSERT(false, "Shouldn't be called after shutdown!");
|
||||
return NS_ERROR_UNEXPECTED;
|
||||
@ -15921,7 +15905,14 @@ FileManager::Invalidate()
|
||||
MOZ_ASSERT(!mInvalidated);
|
||||
mInvalidated = true;
|
||||
|
||||
mFileInfos.Enumerate(Helper::ClearDBRefs, nullptr);
|
||||
for (auto iter = mFileInfos.Iter(); !iter.Done(); iter.Next()) {
|
||||
FileInfo* info = iter.Data();
|
||||
MOZ_ASSERT(info);
|
||||
|
||||
if (!info->LockedClearDBRefs()) {
|
||||
iter.Remove();
|
||||
}
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user