Bug 1182976 - Part 2: Get rid of the Helper class in QuotaManager::OpenDirectoryInternal; r=janv

This commit is contained in:
Ehsan Akhgari 2015-07-15 22:27:46 -04:00
Родитель 86e260f37c
Коммит 1dc0b53b20
1 изменённых файлов: 5 добавлений и 16 удалений

Просмотреть файл

@ -3168,21 +3168,6 @@ QuotaManager::OpenDirectoryInternal(Nullable<PersistenceType> aPersistenceType,
{ {
MOZ_ASSERT(NS_IsMainThread()); MOZ_ASSERT(NS_IsMainThread());
class MOZ_STACK_CLASS Helper final
{
public:
static PLDHashOperator
Enumerate(nsCStringHashKey* aKey, void* aClosure)
{
auto* client = static_cast<Client*>(aClosure);
MOZ_ASSERT(client);
client->AbortOperations(aKey->GetKey());
return PL_DHASH_NEXT;
}
};
nsRefPtr<DirectoryLockImpl> lock = nsRefPtr<DirectoryLockImpl> lock =
CreateDirectoryLock(aPersistenceType, CreateDirectoryLock(aPersistenceType,
EmptyCString(), EmptyCString(),
@ -3229,7 +3214,11 @@ QuotaManager::OpenDirectoryInternal(Nullable<PersistenceType> aPersistenceType,
for (uint32_t index : MakeRange(uint32_t(Client::TYPE_MAX))) { for (uint32_t index : MakeRange(uint32_t(Client::TYPE_MAX))) {
if (origins[index]) { if (origins[index]) {
origins[index]->EnumerateEntries(Helper::Enumerate, mClients[index]); for (auto iter = origins[index]->Iter(); !iter.Done(); iter.Next()) {
MOZ_ASSERT(mClients[index]);
mClients[index]->AbortOperations(iter.Get()->GetKey());
}
} }
} }
} }