Bug 1209351 (part 6) - Optimize nsTHashTable::RemoveEntry() usage in toolkit/. r=froydnj.
authorNicholas Nethercote <nnethercote@mozilla.com>
Thu, 24 Sep 2015 21:38:04 -0700
changeset 265981 6dff11f5236ead77e644f65487b4287ee66222da
parent 265980 e33b7964a131be119ae22da2ad39e2eb898133d3
child 265982 37fe4bcc5c314dae4c8b4b182a427191d27b486c
push id29476
push usercbook@mozilla.com
push dateMon, 05 Oct 2015 10:02:13 +0000
treeherdermozilla-central@45f01961ecd0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfroydnj
bugs1209351
milestone44.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 1209351 (part 6) - Optimize nsTHashTable::RemoveEntry() usage in toolkit/. r=froydnj.
toolkit/components/places/AsyncFaviconHelpers.cpp
toolkit/components/places/History.cpp
toolkit/components/telemetry/Telemetry.cpp
toolkit/crashreporter/nsExceptionHandler.cpp
--- a/toolkit/components/places/AsyncFaviconHelpers.cpp
+++ b/toolkit/components/places/AsyncFaviconHelpers.cpp
@@ -394,17 +394,17 @@ AsyncFetchAndSetIconForPage::start(nsIUR
   nsFaviconService* favicons = nsFaviconService::GetFaviconService();
   NS_ENSURE_STATE(favicons);
 
   UnassociatedIconHashKey* iconKey =
     favicons->mUnassociatedIcons.GetEntry(aFaviconURI);
 
   if (iconKey) {
     icon = iconKey->iconData;
-    favicons->mUnassociatedIcons.RemoveEntry(aFaviconURI);
+    favicons->mUnassociatedIcons.RemoveEntry(iconKey);
   } else {
     icon.fetchMode = aFetchMode;
     rv = aFaviconURI->GetSpec(icon.spec);
     NS_ENSURE_SUCCESS(rv, rv);
   }
 
   // If the page url points to an image, the icon's url will be the same.
   // In future evaluate to store a resample of the image.  For now avoid that
--- a/toolkit/components/places/History.cpp
+++ b/toolkit/components/places/History.cpp
@@ -2006,17 +2006,17 @@ History::NotifyVisited(nsIURI* aURI)
       // Verify that the observers hash doesn't mutate while looping through
       // the links associated with this URI.
       MOZ_ASSERT(key == mObservers.GetEntry(aURI),
                  "The URIs hash mutated!");
     }
   }
 
   // All the registered nodes can now be removed for this URI.
-  mObservers.RemoveEntry(aURI);
+  mObservers.RemoveEntry(key);
   return NS_OK;
 }
 
 class ConcurrentStatementsHolder final : public mozIStorageCompletionCallback {
 public:
   NS_DECL_ISUPPORTS
 
   explicit ConcurrentStatementsHolder(mozIStorageConnection* aDBConn)
--- a/toolkit/components/telemetry/Telemetry.cpp
+++ b/toolkit/components/telemetry/Telemetry.cpp
@@ -2183,17 +2183,17 @@ TelemetryImpl::UnregisterAddonHistograms
 {
   AddonEntryType *addonEntry = mAddonMap.GetEntry(id);
   if (addonEntry) {
     // Histogram's destructor is private, so this is the best we can do.
     // The histograms the addon created *will* stick around, but they
     // will be deleted if and when the addon registers histograms with
     // the same names.
     delete addonEntry->mData;
-    mAddonMap.RemoveEntry(id);
+    mAddonMap.RemoveEntry(addonEntry);
   }
 
   return NS_OK;
 }
 
 nsresult
 TelemetryImpl::CreateHistogramSnapshots(JSContext *cx,
                                         JS::MutableHandle<JS::Value> ret,
--- a/toolkit/crashreporter/nsExceptionHandler.cpp
+++ b/toolkit/crashreporter/nsExceptionHandler.cpp
@@ -3084,18 +3084,18 @@ TakeMinidumpForChild(uint32_t childPid, 
   ChildProcessData* pd = pidToMinidump->GetEntry(childPid);
   if (!pd)
     return false;
 
   NS_IF_ADDREF(*dump = pd->minidump);
   if (aSequence) {
     *aSequence = pd->sequence;
   }
-  
-  pidToMinidump->RemoveEntry(childPid);
+
+  pidToMinidump->RemoveEntry(pd);
 
   return !!*dump;
 }
 
 //-----------------------------------------------------------------------------
 // CreatePairedMinidumps() and helpers
 //