зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1187139 (part 1) - Replace nsBaseHashtable::Enumerate() calls in accessible/ with iterators. r=tbsaunde.
--HG-- extra : rebase_source : 4cc04928bee921db2088af358439958d5d2fd6f5
This commit is contained in:
Родитель
d89b2a6a22
Коммит
ca220cda4d
|
@ -12,20 +12,6 @@
|
|||
// Accessible cache utils
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/**
|
||||
* Shutdown and removes the accessible from cache.
|
||||
*/
|
||||
template <class T>
|
||||
static PLDHashOperator
|
||||
ClearCacheEntry(const void* aKey, RefPtr<T>& aAccessible, void* aUserArg)
|
||||
{
|
||||
NS_ASSERTION(aAccessible, "Calling ClearCacheEntry with a nullptr pointer!");
|
||||
if (aAccessible && !aAccessible->IsDefunct())
|
||||
aAccessible->Shutdown();
|
||||
|
||||
return PL_DHASH_REMOVE;
|
||||
}
|
||||
|
||||
template <class T>
|
||||
static PLDHashOperator
|
||||
UnbindCacheEntryFromDocument(const void* aKey, RefPtr<T>& aAccessible,
|
||||
|
@ -40,12 +26,18 @@ UnbindCacheEntryFromDocument(const void* aKey, RefPtr<T>& aAccessible,
|
|||
/**
|
||||
* Clear the cache and shutdown the accessibles.
|
||||
*/
|
||||
|
||||
template <class T>
|
||||
static void
|
||||
ClearCache(nsRefPtrHashtable<nsPtrHashKey<const void>, T>& aCache)
|
||||
{
|
||||
aCache.Enumerate(ClearCacheEntry<T>, nullptr);
|
||||
for (auto iter = aCache.Iter(); !iter.Done(); iter.Next()) {
|
||||
T* accessible = iter.Data();
|
||||
MOZ_ASSERT(accessible);
|
||||
if (accessible && !accessible->IsDefunct()) {
|
||||
accessible->Shutdown();
|
||||
}
|
||||
iter.Remove();
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
Загрузка…
Ссылка в новой задаче