mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1187139 (part 2) - Replace nsBaseHashtable::Enumerate() calls in accessible/ with iterators. r=tbsaunde.
This commit is contained in:
parent
79d571c5c9
commit
5a8d025266
@ -13,14 +13,16 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
template <class T>
|
||||
static PLDHashOperator
|
||||
UnbindCacheEntryFromDocument(const void* aKey, RefPtr<T>& aAccessible,
|
||||
void* aUserArg)
|
||||
void
|
||||
UnbindCacheEntriesFromDocument(
|
||||
nsRefPtrHashtable<nsPtrHashKey<const void>, T>& aCache)
|
||||
{
|
||||
MOZ_ASSERT(aAccessible && !aAccessible->IsDefunct());
|
||||
aAccessible->Document()->UnbindFromDocument(aAccessible);
|
||||
|
||||
return PL_DHASH_REMOVE;
|
||||
for (auto iter = aCache.Iter(); !iter.Done(); iter.Next()) {
|
||||
T* accessible = iter.Data();
|
||||
MOZ_ASSERT(accessible && !accessible->IsDefunct());
|
||||
accessible->Document()->UnbindFromDocument(accessible);
|
||||
iter.Remove();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -145,8 +145,9 @@ XULTreeAccessible::Value(nsString& aValue)
|
||||
void
|
||||
XULTreeAccessible::Shutdown()
|
||||
{
|
||||
if (!mDoc->IsDefunct())
|
||||
mAccessibleCache.Enumerate(UnbindCacheEntryFromDocument<Accessible>, nullptr);
|
||||
if (!mDoc->IsDefunct()) {
|
||||
UnbindCacheEntriesFromDocument(mAccessibleCache);
|
||||
}
|
||||
|
||||
mTree = nullptr;
|
||||
mTreeView = nullptr;
|
||||
@ -550,8 +551,7 @@ XULTreeAccessible::InvalidateCache(int32_t aRow, int32_t aCount)
|
||||
return;
|
||||
|
||||
if (!mTreeView) {
|
||||
mAccessibleCache.Enumerate(UnbindCacheEntryFromDocument<Accessible>,
|
||||
nullptr);
|
||||
UnbindCacheEntriesFromDocument(mAccessibleCache);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -609,8 +609,7 @@ XULTreeAccessible::TreeViewInvalidated(int32_t aStartRow, int32_t aEndRow,
|
||||
return;
|
||||
|
||||
if (!mTreeView) {
|
||||
mAccessibleCache.Enumerate(UnbindCacheEntryFromDocument<Accessible>,
|
||||
nullptr);
|
||||
UnbindCacheEntriesFromDocument(mAccessibleCache);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -669,8 +668,7 @@ XULTreeAccessible::TreeViewChanged(nsITreeView* aView)
|
||||
Document()->FireDelayedEvent(reorderEvent);
|
||||
|
||||
// Clear cache.
|
||||
mAccessibleCache.Enumerate(UnbindCacheEntryFromDocument<Accessible>,
|
||||
nullptr);
|
||||
UnbindCacheEntriesFromDocument(mAccessibleCache);
|
||||
|
||||
mTreeView = aView;
|
||||
}
|
||||
@ -687,7 +685,7 @@ XULTreeAccessible::CreateTreeItemAccessible(int32_t aRow) const
|
||||
|
||||
return accessible.forget();
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// XULTreeItemAccessibleBase
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -277,8 +277,7 @@ void
|
||||
XULTreeGridRowAccessible::Shutdown()
|
||||
{
|
||||
if (!mDoc->IsDefunct()) {
|
||||
mAccessibleCache.Enumerate(UnbindCacheEntryFromDocument<XULTreeGridCellAccessible>,
|
||||
nullptr);
|
||||
UnbindCacheEntriesFromDocument(mAccessibleCache);
|
||||
}
|
||||
|
||||
XULTreeItemAccessibleBase::Shutdown();
|
||||
|
Loading…
Reference in New Issue
Block a user