author | Nicholas Nethercote <nnethercote@mozilla.com> |
Sun, 29 Nov 2015 14:02:07 -0800 | |
changeset 274858 | a7ba739d20a99e0808eed568175aa9404f2b4929 |
parent 274857 | c91eff1c2734d0ac4a056e4938c767f6cb6cd8a4 |
child 274859 | 06f4c59269952cb31914815e3b69d038f0da3c8d |
push id | 29739 |
push user | cbook@mozilla.com |
push date | Tue, 01 Dec 2015 14:26:30 +0000 |
treeherder | mozilla-central@974fe614d529 [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | tbsaunde |
bugs | 1187139 |
milestone | 45.0a1 |
first release with | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
last release without | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
--- a/accessible/base/nsAccCache.h +++ b/accessible/base/nsAccCache.h @@ -7,45 +7,37 @@ #define _nsAccCache_H_ #include "xpcAccessibleDocument.h" //////////////////////////////////////////////////////////////////////////////// // 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, void* aUserArg) { MOZ_ASSERT(aAccessible && !aAccessible->IsDefunct()); aAccessible->Document()->UnbindFromDocument(aAccessible); return PL_DHASH_REMOVE; } /** * 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