Bug 1187139 (part 3) - Replace nsBaseHashtable::Enumerate() calls in accessible/ with iterators. r=tbsaunde.
authorNicholas Nethercote <nnethercote@mozilla.com>
Sun, 29 Nov 2015 14:02:07 -0800
changeset 274860 32528aa361207af33918e2986342bf176d8e4749
parent 274859 06f4c59269952cb31914815e3b69d038f0da3c8d
child 274861 ff6fafc6b72a41d2a0ce750db83a4fb527f1e58a
push id29739
push usercbook@mozilla.com
push dateTue, 01 Dec 2015 14:26:30 +0000
treeherdermozilla-central@974fe614d529 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstbsaunde
bugs1187139
milestone45.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
Bug 1187139 (part 3) - Replace nsBaseHashtable::Enumerate() calls in accessible/ with iterators. r=tbsaunde.
accessible/xpcom/xpcAccessibleDocument.cpp
--- a/accessible/xpcom/xpcAccessibleDocument.cpp
+++ b/accessible/xpcom/xpcAccessibleDocument.cpp
@@ -190,22 +190,17 @@ xpcAccessibleDocument::GetAccessible(Acc
     xpcAcc = new xpcAccessibleHyperText(aAccessible);
   else
     xpcAcc = new xpcAccessibleGeneric(aAccessible);
 
   mCache.Put(aAccessible, xpcAcc);
   return xpcAcc;
 }
 
-static PLDHashOperator
-ShutdownAndRemove(const Accessible* aKey, RefPtr<xpcAccessibleGeneric>& aValue,
-                  void* aUnused)
-{
-  aValue->Shutdown();
-  return PL_DHASH_REMOVE;
-}
-
 void
 xpcAccessibleDocument::Shutdown()
 {
-  mCache.Enumerate(ShutdownAndRemove, nullptr);
+  for (auto iter = mCache.Iter(); !iter.Done(); iter.Next()) {
+    iter.Data()->Shutdown();
+    iter.Remove();
+  }
   xpcAccessibleGeneric::Shutdown();
 }