Bug 1121760 (part 3) - Remove PL_DHashTableRemove(). r=poiru.
authorNicholas Nethercote <nnethercote@mozilla.com>
Mon, 14 Sep 2015 14:23:24 -0700
changeset 262709 108f4bf0585b22a5d5d44c280a8e1c463ae329ef
parent 262708 16597175b6f3678f38020fdf4c4a7f4debf38d2e
child 262710 f957524fc6248406f1029dac87869ea3e77fd75d
push id29381
push userkwierso@gmail.com
push dateWed, 16 Sep 2015 17:53:22 +0000
treeherdermozilla-central@3618c94059d8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspoiru
bugs1121760
milestone43.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 1121760 (part 3) - Remove PL_DHashTableRemove(). r=poiru.
dom/base/nsContentList.cpp
dom/base/nsDocument.cpp
dom/base/nsScriptNameSpaceManager.cpp
dom/plugins/base/nsJSNPRuntime.cpp
dom/xul/templates/nsContentSupportMap.cpp
dom/xul/templates/nsTemplateMap.h
embedding/components/commandhandler/nsCommandParams.cpp
js/xpconnect/src/XPCMaps.h
layout/base/nsFrameManager.cpp
layout/style/nsHTMLStyleSheet.cpp
netwerk/base/nsLoadGroup.cpp
netwerk/cache/nsCacheEntry.cpp
netwerk/cache/nsDiskCacheBinding.cpp
netwerk/dns/nsHostResolver.cpp
rdf/base/nsInMemoryDataSource.cpp
rdf/base/nsRDFService.cpp
security/manager/ssl/nsCertTree.cpp
security/manager/ssl/nsNSSShutDown.cpp
uriloader/base/nsDocLoader.cpp
xpcom/ds/nsAtomTable.cpp
xpcom/glue/nsTHashtable.h
xpcom/glue/pldhash.cpp
xpcom/glue/pldhash.h
xpcom/tests/gtest/TestPLDHash.cpp
--- a/dom/base/nsContentList.cpp
+++ b/dom/base/nsContentList.cpp
@@ -966,17 +966,17 @@ nsContentList::RemoveFromHashtable()
   uint32_t recentlyUsedCacheIndex = RecentlyUsedCacheIndex(key);
   if (sRecentlyUsedContentLists[recentlyUsedCacheIndex] == this) {
     sRecentlyUsedContentLists[recentlyUsedCacheIndex] = nullptr;
   }
 
   if (!gContentListHashTable)
     return;
 
-  PL_DHashTableRemove(gContentListHashTable, &key);
+  gContentListHashTable->Remove(&key);
 
   if (gContentListHashTable->EntryCount() == 0) {
     delete gContentListHashTable;
     gContentListHashTable = nullptr;
   }
 }
 
 void
@@ -1007,17 +1007,17 @@ nsCacheableFuncStringContentList::~nsCac
 void
 nsCacheableFuncStringContentList::RemoveFromFuncStringHashtable()
 {
   if (!gFuncStringContentListHashTable) {
     return;
   }
 
   nsFuncStringCacheKey key(mRootNode, mFunc, mString);
-  PL_DHashTableRemove(gFuncStringContentListHashTable, &key);
+  gFuncStringContentListHashTable->Remove(&key);
 
   if (gFuncStringContentListHashTable->EntryCount() == 0) {
     delete gFuncStringContentListHashTable;
     gFuncStringContentListHashTable = nullptr;
   }
 }
 
 #ifdef DEBUG_CONTENT_LIST
--- a/dom/base/nsDocument.cpp
+++ b/dom/base/nsDocument.cpp
@@ -3943,17 +3943,17 @@ nsresult
 nsDocument::SetSubDocumentFor(Element* aElement, nsIDocument* aSubDoc)
 {
   NS_ENSURE_TRUE(aElement, NS_ERROR_UNEXPECTED);
 
   if (!aSubDoc) {
     // aSubDoc is nullptr, remove the mapping
 
     if (mSubDocuments) {
-      PL_DHashTableRemove(mSubDocuments, aElement);
+      mSubDocuments->Remove(aElement);
     }
   } else {
     if (!mSubDocuments) {
       // Create a new hashtable
 
       static const PLDHashTableOps hash_table_ops =
       {
         PL_DHashVoidPtrKeyStub,
--- a/dom/base/nsScriptNameSpaceManager.cpp
+++ b/dom/base/nsScriptNameSpaceManager.cpp
@@ -143,17 +143,17 @@ nsScriptNameSpaceManager::AddToHash(PLDH
 
   return &entry->mGlobalName;
 }
 
 void
 nsScriptNameSpaceManager::RemoveFromHash(PLDHashTable *aTable,
                                          const nsAString *aKey)
 {
-  PL_DHashTableRemove(aTable, aKey);
+  aTable->Remove(aKey);
 }
 
 nsGlobalNameStruct*
 nsScriptNameSpaceManager::GetConstructorProto(const nsGlobalNameStruct* aStruct)
 {
   NS_ASSERTION(aStruct->mType == nsGlobalNameStruct::eTypeExternalConstructorAlias,
                "This function only works on constructor aliases!");
   if (!aStruct->mAlias->mProto) {
--- a/dom/plugins/base/nsJSNPRuntime.cpp
+++ b/dom/plugins/base/nsJSNPRuntime.cpp
@@ -1750,17 +1750,17 @@ NPObjWrapper_Convert(JSContext *cx, JS::
 }
 
 static void
 NPObjWrapper_Finalize(js::FreeOp *fop, JSObject *obj)
 {
   NPObject *npobj = (NPObject *)::JS_GetPrivate(obj);
   if (npobj) {
     if (sNPObjWrappers) {
-      PL_DHashTableRemove(sNPObjWrappers, npobj);
+      sNPObjWrappers->Remove(npobj);
     }
   }
 
   if (!sDelayedReleases)
     sDelayedReleases = new nsTArray<NPObject*>;
   sDelayedReleases->AppendElement(npobj);
 }
 
--- a/dom/xul/templates/nsContentSupportMap.cpp
+++ b/dom/xul/templates/nsContentSupportMap.cpp
@@ -6,13 +6,13 @@
 #include "nsContentSupportMap.h"
 #include "nsXULElement.h"
 
 void
 nsContentSupportMap::Remove(nsIContent* aElement)
 {
     nsIContent* child = aElement;
     do {
-        PL_DHashTableRemove(&mMap, child);
+        mMap.Remove(child);
         child = child->GetNextNode(aElement);
     } while(child);
 }
 
--- a/dom/xul/templates/nsTemplateMap.h
+++ b/dom/xul/templates/nsTemplateMap.h
@@ -32,17 +32,17 @@ public:
         if (entry) {
             entry->mContent = aContent;
             entry->mTemplate = aTemplate;
         }
     }
 
     void
     Remove(nsIContent* aContent) {
-        PL_DHashTableRemove(&mTable, aContent);
+        mTable.Remove(aContent);
 
         for (nsIContent* child = aContent->GetFirstChild();
              child;
              child = child->GetNextSibling()) {
             Remove(child);
         }
     }
 
--- a/embedding/components/commandhandler/nsCommandParams.cpp
+++ b/embedding/components/commandhandler/nsCommandParams.cpp
@@ -195,17 +195,17 @@ nsCommandParams::SetISupportsValue(const
   }
   foundEntry->mISupports = aValue; // addrefs
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsCommandParams::RemoveValue(const char* aName)
 {
-  PL_DHashTableRemove(&mValuesHash, (void*)aName);
+  mValuesHash.Remove((void*)aName);
   return NS_OK;
 }
 
 nsCommandParams::HashEntry*
 nsCommandParams::GetNamedEntry(const char* aName)
 {
   return static_cast<HashEntry*>(mValuesHash.Search((void*)aName));
 }
--- a/js/xpconnect/src/XPCMaps.h
+++ b/js/xpconnect/src/XPCMaps.h
@@ -138,17 +138,17 @@ public:
         NS_PRECONDITION(wrapper,"bad param");
 #ifdef DEBUG
         XPCWrappedNative* wrapperInMap = Find(wrapper->GetIdentityObject());
         MOZ_ASSERT(!wrapperInMap || wrapperInMap == wrapper,
                    "About to remove a different wrapper with the same "
                    "nsISupports identity! This will most likely cause serious "
                    "problems!");
 #endif
-        PL_DHashTableRemove(mTable, wrapper->GetIdentityObject());
+        mTable->Remove(wrapper->GetIdentityObject());
     }
 
     inline uint32_t Count() { return mTable->EntryCount(); }
 
     PLDHashTable::Iterator Iter() const { return PLDHashTable::Iterator(mTable); }
     size_t SizeOfIncludingThis(mozilla::MallocSizeOf mallocSizeOf) const;
 
     ~Native2WrappedNativeMap();
@@ -193,17 +193,17 @@ public:
         entry->key = iid;
         entry->value = clazz;
         return clazz;
     }
 
     inline void Remove(nsXPCWrappedJSClass* clazz)
     {
         NS_PRECONDITION(clazz,"bad param");
-        PL_DHashTableRemove(mTable, &clazz->GetIID());
+        mTable->Remove(&clazz->GetIID());
     }
 
     inline uint32_t Count() { return mTable->EntryCount(); }
 
     PLDHashTable::Iterator Iter() const { return PLDHashTable::Iterator(mTable); }
 
     ~IID2WrappedJSClassMap();
 private:
@@ -246,17 +246,17 @@ public:
         entry->key = iid;
         entry->value = iface;
         return iface;
     }
 
     inline void Remove(XPCNativeInterface* iface)
     {
         NS_PRECONDITION(iface,"bad param");
-        PL_DHashTableRemove(mTable, iface->GetIID());
+        mTable->Remove(iface->GetIID());
     }
 
     inline uint32_t Count() { return mTable->EntryCount(); }
 
     PLDHashTable::Iterator Iter() { return PLDHashTable::Iterator(mTable); }
 
     size_t SizeOfIncludingThis(mozilla::MallocSizeOf mallocSizeOf) const;
 
@@ -299,17 +299,17 @@ public:
         entry->key = info;
         entry->value = set;
         return set;
     }
 
     inline void Remove(nsIClassInfo* info)
     {
         NS_PRECONDITION(info,"bad param");
-        PL_DHashTableRemove(mTable, info);
+        mTable->Remove(info);
     }
 
     inline uint32_t Count() { return mTable->EntryCount(); }
 
     PLDHashTable::Iterator Iter() { return PLDHashTable::Iterator(mTable); }
 
     // ClassInfo2NativeSetMap holds pointers to *some* XPCNativeSets.
     // So we don't want to count those XPCNativeSets, because they are better
@@ -355,17 +355,17 @@ public:
         entry->key = info;
         entry->value = proto;
         return proto;
     }
 
     inline void Remove(nsIClassInfo* info)
     {
         NS_PRECONDITION(info,"bad param");
-        PL_DHashTableRemove(mTable, info);
+        mTable->Remove(info);
     }
 
     inline uint32_t Count() { return mTable->EntryCount(); }
 
     PLDHashTable::Iterator Iter() const { return PLDHashTable::Iterator(mTable); }
     PLDHashTable::Iterator Iter() { return PLDHashTable::Iterator(mTable); }
 
     size_t SizeOfIncludingThis(mozilla::MallocSizeOf mallocSizeOf) const;
@@ -423,17 +423,17 @@ public:
         return Add(&key, set);
     }
 
     inline void Remove(XPCNativeSet* set)
     {
         NS_PRECONDITION(set,"bad param");
 
         XPCNativeSetKey key(set, nullptr, 0);
-        PL_DHashTableRemove(mTable, &key);
+        mTable->Remove(&key);
     }
 
     inline uint32_t Count() { return mTable->EntryCount(); }
 
     PLDHashTable::Iterator Iter() const { return PLDHashTable::Iterator(mTable); }
     PLDHashTable::Iterator Iter() { return PLDHashTable::Iterator(mTable); }
 
     size_t SizeOfIncludingThis(mozilla::MallocSizeOf mallocSizeOf) const;
@@ -484,17 +484,17 @@ public:
             return nullptr;
         entry->value = obj;
         entry->key = iid;
         return obj;
     }
 
     inline void Remove(REFNSIID iid)
     {
-        PL_DHashTableRemove(mTable, &iid);
+        mTable->Remove(&iid);
     }
 
     inline uint32_t Count() { return mTable->EntryCount(); }
 
     ~IID2ThisTranslatorMap();
 private:
     IID2ThisTranslatorMap();    // no implementation
     explicit IID2ThisTranslatorMap(int size);
@@ -558,17 +558,17 @@ public:
             return (XPCWrappedNativeProto*) entry->key;
         entry->key = proto;
         return proto;
     }
 
     inline void Remove(XPCWrappedNativeProto* proto)
     {
         NS_PRECONDITION(proto,"bad param");
-        PL_DHashTableRemove(mTable, proto);
+        mTable->Remove(proto);
     }
 
     inline uint32_t Count() { return mTable->EntryCount(); }
 
     PLDHashTable::Iterator Iter() const { return PLDHashTable::Iterator(mTable); }
     PLDHashTable::Iterator Iter() { return PLDHashTable::Iterator(mTable); }
 
     ~XPCWrappedNativeProtoMap();
--- a/layout/base/nsFrameManager.cpp
+++ b/layout/base/nsFrameManager.cpp
@@ -192,18 +192,17 @@ nsFrameManager::RegisterPlaceholderFrame
 
 void
 nsFrameManager::UnregisterPlaceholderFrame(nsPlaceholderFrame* aPlaceholderFrame)
 {
   NS_PRECONDITION(aPlaceholderFrame, "null param unexpected");
   NS_PRECONDITION(nsGkAtoms::placeholderFrame == aPlaceholderFrame->GetType(),
                   "unexpected frame type");
 
-  PL_DHashTableRemove(&mPlaceholderMap,
-                      aPlaceholderFrame->GetOutOfFlowFrame());
+  mPlaceholderMap.Remove(aPlaceholderFrame->GetOutOfFlowFrame());
 }
 
 void
 nsFrameManager::ClearPlaceholderFrameMap()
 {
   for (auto iter = mPlaceholderMap.Iter(); !iter.Done(); iter.Next()) {
     auto entry = static_cast<PlaceholderMapEntry*>(iter.Get());
     entry->placeholderFrame->SetOutOfFlowFrame(nullptr);
--- a/layout/style/nsHTMLStyleSheet.cpp
+++ b/layout/style/nsHTMLStyleSheet.cpp
@@ -487,17 +487,17 @@ void
 nsHTMLStyleSheet::DropMappedAttributes(nsMappedAttributes* aMapped)
 {
   NS_ENSURE_TRUE_VOID(aMapped);
 
 #ifdef DEBUG
   uint32_t entryCount = mMappedAttrTable.EntryCount() - 1;
 #endif
 
-  PL_DHashTableRemove(&mMappedAttrTable, aMapped);
+  mMappedAttrTable.Remove(aMapped);
 
   NS_ASSERTION(entryCount == mMappedAttrTable.EntryCount(), "not removed");
 }
 
 nsIStyleRule*
 nsHTMLStyleSheet::LangRuleFor(const nsString& aLanguage)
 {
   auto entry =
--- a/netwerk/base/nsLoadGroup.cpp
+++ b/netwerk/base/nsLoadGroup.cpp
@@ -523,17 +523,17 @@ nsLoadGroup::AddRequest(nsIRequest *requ
             if (NS_FAILED(rv)) {
                 LOG(("LOADGROUP [%x]: OnStartRequest for request %x FAILED.\n",
                     this, request));
                 //
                 // The URI load has been canceled by the observer.  Clean up
                 // the damage...
                 //
 
-                PL_DHashTableRemove(&mRequests, request);
+                mRequests.Remove(request);
 
                 rv = NS_OK;
 
                 mForegroundCount -= 1;
             }
         }
 
         // Ensure that we're part of our loadgroup while pending
--- a/netwerk/cache/nsCacheEntry.cpp
+++ b/netwerk/cache/nsCacheEntry.cpp
@@ -454,17 +454,17 @@ nsCacheEntryHashTable::RemoveEntry( nsCa
 
     if (!initialized)  return; // NS_ERROR_NOT_INITIALIZED
 
 #if DEBUG
     // XXX debug code to make sure we have the entry we're trying to remove
     nsCacheEntry *check = GetEntry(&(cacheEntry->mKey));
     NS_ASSERTION(check == cacheEntry, "### Attempting to remove unknown cache entry!!!");
 #endif
-    PL_DHashTableRemove(&table, &(cacheEntry->mKey));
+    table.Remove(&(cacheEntry->mKey));
 }
 
 PLDHashTable::Iterator
 nsCacheEntryHashTable::Iter()
 {
     return PLDHashTable::Iterator(&table);
 }
 
--- a/netwerk/cache/nsDiskCacheBinding.cpp
+++ b/netwerk/cache/nsDiskCacheBinding.cpp
@@ -296,18 +296,17 @@ nsDiskCacheBindery::RemoveBinding(nsDisk
     if (!hashEntry) {
         NS_WARNING("### disk cache: binding not in hashtable!");
         return;
     }
     
     if (binding == hashEntry->mBinding) {
         if (PR_CLIST_IS_EMPTY(binding)) {
             // remove this hash entry
-            PL_DHashTableRemove(&table,
-                                (void*)(uintptr_t) binding->mRecord.HashNumber());
+            table.Remove((void*)(uintptr_t) binding->mRecord.HashNumber());
             return;
             
         } else {
             // promote next binding to head, and unlink this binding
             hashEntry->mBinding = (nsDiskCacheBinding *)PR_NEXT_LINK(binding);
         }
     }
     PR_REMOVE_AND_INIT_LINK(binding);
--- a/netwerk/dns/nsHostResolver.cpp
+++ b/netwerk/dns/nsHostResolver.cpp
@@ -614,17 +614,17 @@ nsHostResolver::FlushCache()
     // Clear the evictionQ and remove all its corresponding entries from
     // the cache first
     if (!PR_CLIST_IS_EMPTY(&mEvictionQ)) {
         PRCList *node = mEvictionQ.next;
         while (node != &mEvictionQ) {
             nsHostRecord *rec = static_cast<nsHostRecord *>(node);
             node = node->next;
             PR_REMOVE_AND_INIT_LINK(rec);
-            PL_DHashTableRemove(&mDB, (nsHostKey *) rec);
+            mDB.Remove((nsHostKey *) rec);
             NS_RELEASE(rec);
         }
     }
 
     // Refresh the cache entries that are resolving RIGHT now, remove the rest.
     for (auto iter = mDB.Iter(); !iter.Done(); iter.Next()) {
         auto entry = static_cast<nsHostDBEnt *>(iter.Get());
         // Try to remove the record, or mark it for refresh.
@@ -1261,17 +1261,17 @@ nsHostResolver::OnLookupComplete(nsHostR
             NS_ADDREF(rec);
             if (mEvictionQSize < mMaxCacheEntries)
                 mEvictionQSize++;
             else {
                 // remove first element on mEvictionQ
                 nsHostRecord *head =
                     static_cast<nsHostRecord *>(PR_LIST_HEAD(&mEvictionQ));
                 PR_REMOVE_AND_INIT_LINK(head);
-                PL_DHashTableRemove(&mDB, (nsHostKey *) head);
+                mDB.Remove((nsHostKey *) head);
 
                 if (!head->negative) {
                     // record the age of the entry upon eviction.
                     TimeDuration age = TimeStamp::NowLoRes() - head->mValidStart;
                     Telemetry::Accumulate(Telemetry::DNS_CLEANUP_AGE,
                                           static_cast<uint32_t>(age.ToSeconds() / 60));
                 }
 
@@ -1337,17 +1337,17 @@ nsHostResolver::CancelAsyncRequest(const
                 callback->OnLookupComplete(this, recPtr, status);
                 break;
             }
             node = node->next;
         }
 
         // If there are no more callbacks, remove the hash table entry
         if (recPtr && PR_CLIST_IS_EMPTY(&recPtr->callbacks)) {
-            PL_DHashTableRemove(&mDB, (nsHostKey *)recPtr);
+            mDB.Remove((nsHostKey *)recPtr);
             // If record is on a Queue, remove it and then deref it
             if (recPtr->next != recPtr) {
                 PR_REMOVE_LINK(recPtr);
                 NS_RELEASE(recPtr);
             }
         }
     }
 }
--- a/rdf/base/nsInMemoryDataSource.cpp
+++ b/rdf/base/nsInMemoryDataSource.cpp
@@ -318,32 +318,32 @@ public:
             auto entry =
                 static_cast<Entry*>(mForwardArcs.Add(u, mozilla::fallible));
             if (entry) {
                 entry->mNode = u;
                 entry->mAssertions = as;
             }
         }
         else {
-            PL_DHashTableRemove(&mForwardArcs, u);
+            mForwardArcs.Remove(u);
         }
     }
 
     void
     SetReverseArcs(nsIRDFNode* v, Assertion* as) {
         if (as) {
             auto entry =
                 static_cast<Entry*>(mReverseArcs.Add(v, mozilla::fallible));
             if (entry) {
                 entry->mNode = v;
                 entry->mAssertions = as;
             }
         }
         else {
-            PL_DHashTableRemove(&mReverseArcs, v);
+            mReverseArcs.Remove(v);
         }
     }
 
     void
     LogOperation(const char* aOperation,
                  nsIRDFResource* asource,
                  nsIRDFResource* aProperty,
                  nsIRDFNode* aTarget,
--- a/rdf/base/nsRDFService.cpp
+++ b/rdf/base/nsRDFService.cpp
@@ -1181,17 +1181,17 @@ RDFServiceImpl::UnregisterResource(nsIRD
            ("rdfserv unregister-resource [%p] %s",
             aResource, (const char*) uri));
 
 #ifdef DEBUG
     if (!mResources.Search(uri))
         NS_WARNING("resource was never registered");
 #endif
 
-    PL_DHashTableRemove(&mResources, uri);
+    mResources.Remove(uri);
     return NS_OK;
 }
 
 NS_IMETHODIMP
 RDFServiceImpl::RegisterDataSource(nsIRDFDataSource* aDataSource, bool aReplace)
 {
     NS_PRECONDITION(aDataSource != nullptr, "null ptr");
     if (! aDataSource)
@@ -1400,17 +1400,17 @@ RDFServiceImpl::RegisterLiteral(nsIRDFLi
 nsresult
 RDFServiceImpl::UnregisterLiteral(nsIRDFLiteral* aLiteral)
 {
     const char16_t* value;
     aLiteral->GetValueConst(&value);
 
     NS_ASSERTION(mLiterals.Search(value), "literal was never registered");
 
-    PL_DHashTableRemove(&mLiterals, value);
+    mLiterals.Remove(value);
 
     // N.B. that we _don't_ release the literal: we only held a weak
     // reference to it in the hashtable.
     MOZ_LOG(gLog, LogLevel::Debug,
            ("rdfserv unregister-literal [%p] %s",
             aLiteral, (const char16_t*) value));
 
     return NS_OK;
@@ -1450,17 +1450,17 @@ RDFServiceImpl::RegisterInt(nsIRDFInt* a
 nsresult
 RDFServiceImpl::UnregisterInt(nsIRDFInt* aInt)
 {
     int32_t value;
     aInt->GetValue(&value);
 
     NS_ASSERTION(mInts.Search(&value), "int was never registered");
 
-    PL_DHashTableRemove(&mInts, &value);
+    mInts.Remove(&value);
 
     // N.B. that we _don't_ release the literal: we only held a weak
     // reference to it in the hashtable.
     MOZ_LOG(gLog, LogLevel::Debug,
            ("rdfserv unregister-int [%p] %d",
             aInt, value));
 
     return NS_OK;
@@ -1500,17 +1500,17 @@ RDFServiceImpl::RegisterDate(nsIRDFDate*
 nsresult
 RDFServiceImpl::UnregisterDate(nsIRDFDate* aDate)
 {
     PRTime value;
     aDate->GetValue(&value);
 
     NS_ASSERTION(mDates.Search(&value), "date was never registered");
 
-    PL_DHashTableRemove(&mDates, &value);
+    mDates.Remove(&value);
 
     // N.B. that we _don't_ release the literal: we only held a weak
     // reference to it in the hashtable.
     MOZ_LOG(gLog, LogLevel::Debug,
            ("rdfserv unregister-date [%p] %ld",
             aDate, value));
 
     return NS_OK;
@@ -1540,17 +1540,17 @@ RDFServiceImpl::RegisterBlob(BlobImpl *a
     return NS_OK;
 }
 
 nsresult
 RDFServiceImpl::UnregisterBlob(BlobImpl *aBlob)
 {
     NS_ASSERTION(mBlobs.Search(&aBlob->mData), "blob was never registered");
 
-    PL_DHashTableRemove(&mBlobs, &aBlob->mData);
+    mBlobs.Remove(&aBlob->mData);
 
      // N.B. that we _don't_ release the literal: we only held a weak
      // reference to it in the hashtable.
     MOZ_LOG(gLog, LogLevel::Debug,
            ("rdfserv unregister-blob [%p] %s",
             aBlob, aBlob->mData.mBytes));
 
     return NS_OK;
--- a/security/manager/ssl/nsCertTree.cpp
+++ b/security/manager/ssl/nsCertTree.cpp
@@ -188,17 +188,17 @@ nsCertTree::getCacheEntry(void *cache, v
   PLDHashTable &aCompareCache = *reinterpret_cast<PLDHashTable*>(cache);
   auto entryPtr = static_cast<CompareCacheHashEntryPtr*>
                              (aCompareCache.Add(aCert, fallible));
   return entryPtr ? entryPtr->entry : nullptr;
 }
 
 void nsCertTree::RemoveCacheEntry(void *key)
 {
-  PL_DHashTableRemove(&mCompareCache, key);
+  mCompareCache.Remove(key);
 }
 
 // CountOrganizations
 //
 // Count the number of different organizations encountered in the cert
 // list.
 int32_t
 nsCertTree::CountOrganizations()
--- a/security/manager/ssl/nsNSSShutDown.cpp
+++ b/security/manager/ssl/nsNSSShutDown.cpp
@@ -64,17 +64,17 @@ void nsNSSShutDownList::remember(nsNSSSh
 
 void nsNSSShutDownList::forget(nsNSSShutDownObject *o)
 {
   if (!singleton)
     return;
   
   PR_ASSERT(o);
   MutexAutoLock lock(singleton->mListLock);
-  PL_DHashTableRemove(&singleton->mObjects, o);
+  singleton->mObjects.Remove(o);
 }
 
 void nsNSSShutDownList::remember(nsOnPK11LogoutCancelObject *o)
 {
   if (!singleton)
     return;
   
   PR_ASSERT(o);
@@ -84,17 +84,17 @@ void nsNSSShutDownList::remember(nsOnPK1
 
 void nsNSSShutDownList::forget(nsOnPK11LogoutCancelObject *o)
 {
   if (!singleton)
     return;
   
   PR_ASSERT(o);
   MutexAutoLock lock(singleton->mListLock);
-  PL_DHashTableRemove(&singleton->mPK11LogoutCancelObjects, o);
+  singleton->mPK11LogoutCancelObjects.Remove(o);
 }
 
 void nsNSSShutDownList::trackSSLSocketCreate()
 {
   if (!singleton)
     return;
   
   MutexAutoLock lock(singleton->mListLock);
--- a/uriloader/base/nsDocLoader.cpp
+++ b/uriloader/base/nsDocLoader.cpp
@@ -1329,17 +1329,17 @@ nsresult nsDocLoader::AddRequestInfo(nsI
     return NS_ERROR_OUT_OF_MEMORY;
   }
 
   return NS_OK;
 }
 
 void nsDocLoader::RemoveRequestInfo(nsIRequest *aRequest)
 {
-  PL_DHashTableRemove(&mRequestInfoHash, aRequest);
+  mRequestInfoHash.Remove(aRequest);
 }
 
 nsDocLoader::nsRequestInfo* nsDocLoader::GetRequestInfo(nsIRequest* aRequest)
 {
   return static_cast<nsRequestInfo*>(mRequestInfoHash.Search(aRequest));
 }
 
 void nsDocLoader::ClearRequestInfoHash(void)
--- a/xpcom/ds/nsAtomTable.cpp
+++ b/xpcom/ds/nsAtomTable.cpp
@@ -392,17 +392,17 @@ AtomImpl::AtomImpl(nsStringBuffer* aStri
 AtomImpl::~AtomImpl()
 {
   MOZ_ASSERT(gAtomTable, "uninitialized atom hashtable");
   // Permanent atoms are removed from the hashtable at shutdown, and we
   // don't want to remove them twice.  See comment above in
   // |AtomTableClearEntry|.
   if (!IsPermanentInDestructor()) {
     AtomTableKey key(mString, mLength, mHash);
-    PL_DHashTableRemove(gAtomTable, &key);
+    gAtomTable->Remove(&key);
     if (gAtomTable->EntryCount() == 0) {
       delete gAtomTable;
       gAtomTable = nullptr;
     }
   }
 
   nsStringBuffer::FromData(mString)->Release();
 }
--- a/xpcom/glue/nsTHashtable.h
+++ b/xpcom/glue/nsTHashtable.h
@@ -155,18 +155,17 @@ public:
   }
 
   /**
    * Remove the entry associated with a key.
    * @param     aKey of the entry to remove
    */
   void RemoveEntry(KeyType aKey)
   {
-    PL_DHashTableRemove(&mTable,
-                        EntryType::KeyToPointer(aKey));
+    mTable.Remove(EntryType::KeyToPointer(aKey));
   }
 
   /**
    * Remove the entry associated with a key, but don't resize the hashtable.
    * This is a low-level method, and is not recommended unless you know what
    * you're doing and you need the extra performance. This method can be used
    * during enumeration, while RemoveEntry() cannot.
    * @param aEntry   the entry-pointer to remove (obtained from GetEntry or
--- a/xpcom/glue/pldhash.cpp
+++ b/xpcom/glue/pldhash.cpp
@@ -645,17 +645,17 @@ PLDHashTable::Add(const void* aKey)
       // an OOM. The multiplication by 2 gets us the size we tried to allocate,
       // which is double the current size.
       NS_ABORT_OOM(2 * EntrySize() * EntryCount());
     }
   }
   return entry;
 }
 
-MOZ_ALWAYS_INLINE void
+void
 PLDHashTable::Remove(const void* aKey)
 {
 #ifdef DEBUG
   AutoWriteOp op(mChecker);
 #endif
 
   PLDHashEntryHdr* entry = mEntryStore.Get()
                          ? SearchTable<ForSearchOrRemove>(aKey,
@@ -673,22 +673,16 @@ PLDHashTable::RemoveEntry(PLDHashEntryHd
 #ifdef DEBUG
   AutoWriteOp op(mChecker);
 #endif
 
   RawRemove(aEntry);
   ShrinkIfAppropriate();
 }
 
-void PL_DHASH_FASTCALL
-PL_DHashTableRemove(PLDHashTable* aTable, const void* aKey)
-{
-  aTable->Remove(aKey);
-}
-
 MOZ_ALWAYS_INLINE void
 PLDHashTable::RawRemove(PLDHashEntryHdr* aEntry)
 {
   // Unfortunately, we can only do weak checking here. That's because
   // RawRemove() can be called legitimately while an Enumerate() call is
   // active, which doesn't fit well into how Checker's mState variable works.
   MOZ_ASSERT(mChecker.IsWritable());
 
--- a/xpcom/glue/pldhash.h
+++ b/xpcom/glue/pldhash.h
@@ -615,19 +615,16 @@ void
 PL_DHashClearEntryStub(PLDHashTable* aTable, PLDHashEntryHdr* aEntry);
 
 // If you use PLDHashEntryStub or a subclass of it as your entry struct, and
 // if your entries move via memcpy and clear via memset(0), you can use these
 // stub operations.
 const PLDHashTableOps*
 PL_DHashGetStubOps(void);
 
-void PL_DHASH_FASTCALL
-PL_DHashTableRemove(PLDHashTable* aTable, const void* aKey);
-
 void
 PL_DHashTableRawRemove(PLDHashTable* aTable, PLDHashEntryHdr* aEntry);
 
 #ifdef DEBUG
 void
 PL_DHashMarkTableImmutable(PLDHashTable* aTable);
 #endif
 
--- a/xpcom/tests/gtest/TestPLDHash.cpp
+++ b/xpcom/tests/gtest/TestPLDHash.cpp
@@ -126,17 +126,17 @@ TEST(PLDHashTableTest, LazyStorage)
   ASSERT_EQ(t.Capacity(), 0u);
   ASSERT_EQ(t.EntrySize(), sizeof(PLDHashEntryStub));
   ASSERT_EQ(t.EntryCount(), 0u);
   ASSERT_EQ(t.Generation(), 0u);
 
   ASSERT_TRUE(!t.Search((const void*)1));
 
   // No result to check here, but call it to make sure it doesn't crash.
-  PL_DHashTableRemove(&t, (const void*)2);
+  t.Remove((const void*)2);
 
   for (auto iter = t.Iter(); !iter.Done(); iter.Next()) {
     ASSERT_TRUE(false); // shouldn't hit this on an empty table
   }
 
   ASSERT_EQ(t.ShallowSizeOfExcludingThis(moz_malloc_size_of), 0u);
 }