From ecf0b741cd08976ed180a8a314dccf607cf902f8 Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Mon, 14 Sep 2015 14:23:26 -0700 Subject: [PATCH] Bug 1121760 (part 4) - Remove PL_DHashTableRawRemove(). r=poiru. --HG-- extra : rebase_source : 9989b2171b8213512ce779415812fa04471fde22 --- dom/base/nsContentUtils.cpp | 2 +- dom/plugins/base/nsJSNPRuntime.cpp | 4 ++-- rdf/base/nsInMemoryDataSource.cpp | 4 ++-- xpcom/glue/nsTHashtable.h | 2 +- xpcom/glue/pldhash.cpp | 8 +------- xpcom/glue/pldhash.h | 3 --- 6 files changed, 7 insertions(+), 16 deletions(-) diff --git a/dom/base/nsContentUtils.cpp b/dom/base/nsContentUtils.cpp index c5b453fb7021..adc633491aef 100644 --- a/dom/base/nsContentUtils.cpp +++ b/dom/base/nsContentUtils.cpp @@ -4192,7 +4192,7 @@ nsContentUtils::RemoveListenerManager(nsINode *aNode) listenerManager.swap(entry->mListenerManager); // Remove the entry and *then* do operations that could cause further // modification of sEventListenerManagersHash. See bug 334177. - PL_DHashTableRawRemove(sEventListenerManagersHash, entry); + sEventListenerManagersHash->RawRemove(entry); if (listenerManager) { listenerManager->Disconnect(); } diff --git a/dom/plugins/base/nsJSNPRuntime.cpp b/dom/plugins/base/nsJSNPRuntime.cpp index 0284a4dafaca..62867e165107 100644 --- a/dom/plugins/base/nsJSNPRuntime.cpp +++ b/dom/plugins/base/nsJSNPRuntime.cpp @@ -1845,7 +1845,7 @@ nsNPObjWrapper::OnDestroy(NPObject *npobj) ::JS_SetPrivate(entry->mJSObj, nullptr); // Remove the npobj from the hash now that it went away. - PL_DHashTableRawRemove(sNPObjWrappers, entry); + sNPObjWrappers->RawRemove(entry); // The finalize hook will call OnWrapperDestroyed(). } @@ -1926,7 +1926,7 @@ nsNPObjWrapper::GetNewOrUsed(NPP npp, JSContext *cx, NPObject *npobj) if (!obj) { // OOM? Remove the stale entry from the hash. - PL_DHashTableRawRemove(sNPObjWrappers, entry); + sNPObjWrappers->RawRemove(entry); return nullptr; } diff --git a/rdf/base/nsInMemoryDataSource.cpp b/rdf/base/nsInMemoryDataSource.cpp index 59071cf64419..5a3da205adff 100644 --- a/rdf/base/nsInMemoryDataSource.cpp +++ b/rdf/base/nsInMemoryDataSource.cpp @@ -1223,7 +1223,7 @@ InMemoryDataSource::LockedUnassert(nsIRDFResource* aSource, as = next; if (first) { - PL_DHashTableRawRemove(root->u.hash.mPropertyHash, hdr); + root->u.hash.mPropertyHash->RawRemove(hdr); if (next && next->mNext) { PLDHashEntryHdr* hdr = @@ -1858,7 +1858,7 @@ InMemoryDataSource::SweepForwardArcsEntries(PLDHashTable* aTable, // Wow, it was the _only_ one. Unhash it. if (! rentry->mAssertions) { - PL_DHashTableRawRemove(aInfo->mReverseArcs, hdr); + aInfo->mReverseArcs->RawRemove(hdr); } // add to the list of assertions to unassert diff --git a/xpcom/glue/nsTHashtable.h b/xpcom/glue/nsTHashtable.h index ad8d44554e40..a2608125f4d2 100644 --- a/xpcom/glue/nsTHashtable.h +++ b/xpcom/glue/nsTHashtable.h @@ -173,7 +173,7 @@ public: */ void RawRemoveEntry(EntryType* aEntry) { - PL_DHashTableRawRemove(&mTable, aEntry); + mTable.RawRemove(aEntry); } // This is an iterator that also allows entry removal. Example usage: diff --git a/xpcom/glue/pldhash.cpp b/xpcom/glue/pldhash.cpp index e68e6ac8e8fd..f182d9d4e2d7 100644 --- a/xpcom/glue/pldhash.cpp +++ b/xpcom/glue/pldhash.cpp @@ -678,7 +678,7 @@ PLDHashTable::RemoveEntry(PLDHashEntryHdr* aEntry) ShrinkIfAppropriate(); } -MOZ_ALWAYS_INLINE void +void PLDHashTable::RawRemove(PLDHashEntryHdr* aEntry) { // Unfortunately, we can only do weak checking here. That's because @@ -702,12 +702,6 @@ PLDHashTable::RawRemove(PLDHashEntryHdr* aEntry) mEntryCount--; } -void -PL_DHashTableRawRemove(PLDHashTable* aTable, PLDHashEntryHdr* aEntry) -{ - aTable->RawRemove(aEntry); -} - // Shrink or compress if a quarter or more of all entries are removed, or if the // table is underloaded according to the minimum alpha, and is not minimal-size // already. diff --git a/xpcom/glue/pldhash.h b/xpcom/glue/pldhash.h index 44d4a4b3bac9..81bf4d788563 100644 --- a/xpcom/glue/pldhash.h +++ b/xpcom/glue/pldhash.h @@ -620,9 +620,6 @@ PL_DHashClearEntryStub(PLDHashTable* aTable, PLDHashEntryHdr* aEntry); const PLDHashTableOps* PL_DHashGetStubOps(void); -void -PL_DHashTableRawRemove(PLDHashTable* aTable, PLDHashEntryHdr* aEntry); - #ifdef DEBUG void PL_DHashMarkTableImmutable(PLDHashTable* aTable);