Bug 1342303 part 3 - Remove nsCOMArray::EnumerateForwards uses in docshell. r=smaug
☠☠ backed out by b0b40ce3dfe5 ☠ ☠
authorXidorn Quan <me@upsuper.org>
Fri, 24 Feb 2017 21:32:20 +1100
changeset 374707 bdc491b9ebde3a05e8f7f4fd834f0354b4a99570
parent 374706 5c6042dee665597e1e21697e0a1de7a2aab60d55
child 374708 bc3b2e7a383b6b0ee08363d642ead4188ecc8a2d
push id10863
push userjlorenzo@mozilla.com
push dateMon, 06 Mar 2017 23:02:23 +0000
treeherdermozilla-aurora@0931190cd725 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs1342303
milestone54.0a1
Bug 1342303 part 3 - Remove nsCOMArray::EnumerateForwards uses in docshell. r=smaug MozReview-Commit-ID: FJen0p0c54u
docshell/shistory/nsSHEntry.cpp
--- a/docshell/shistory/nsSHEntry.cpp
+++ b/docshell/shistory/nsSHEntry.cpp
@@ -54,29 +54,24 @@ nsSHEntry::nsSHEntry(const nsSHEntry& aO
   , mStateData(aOther.mStateData)
   , mIsSrcdocEntry(aOther.mIsSrcdocEntry)
   , mScrollRestorationIsManual(false)
   , mSrcdocData(aOther.mSrcdocData)
   , mBaseURI(aOther.mBaseURI)
 {
 }
 
-static bool
-ClearParentPtr(nsISHEntry* aEntry, void* /* aData */)
-{
-  if (aEntry) {
-    aEntry->SetParent(nullptr);
-  }
-  return true;
-}
-
 nsSHEntry::~nsSHEntry()
 {
   // Null out the mParent pointers on all our kids.
-  mChildren.EnumerateForwards(ClearParentPtr, nullptr);
+  for (nsISHEntry* entry : mChildren) {
+    if (entry) {
+      entry->SetParent(nullptr);
+    }
+  }
 }
 
 NS_IMPL_ISUPPORTS(nsSHEntry, nsISHContainer, nsISHEntry, nsISHEntryInternal)
 
 NS_IMETHODIMP
 nsSHEntry::SetScrollPosition(int32_t aX, int32_t aY)
 {
   mScrollPositionX = aX;