From d25ca898cda2a12968276698f7eb57f915abe9e3 Mon Sep 17 00:00:00 2001 From: Butkovits Atila Date: Mon, 21 Dec 2020 20:20:04 +0200 Subject: [PATCH] Backed out changeset 9b4ab01fda40 (bug 1662676) for gv-junit failures. CLOSED TREE --- modules/libpref/init/StaticPrefList.yaml | 5 ----- netwerk/cache2/CacheIndex.cpp | 22 ---------------------- netwerk/cache2/CacheIndex.h | 4 ---- 3 files changed, 31 deletions(-) diff --git a/modules/libpref/init/StaticPrefList.yaml b/modules/libpref/init/StaticPrefList.yaml index b5a3970945d5..63310345244c 100644 --- a/modules/libpref/init/StaticPrefList.yaml +++ b/modules/libpref/init/StaticPrefList.yaml @@ -8872,11 +8872,6 @@ value: false mirror: always -- name: network.cache.frecency_array_check_enabled - type: RelaxedAtomicBool - value: true - mirror: always - #--------------------------------------------------------------------------- # Prefs starting with "nglayout." #--------------------------------------------------------------------------- diff --git a/netwerk/cache2/CacheIndex.cpp b/netwerk/cache2/CacheIndex.cpp index 87ecb0dbaee9..d3b90cde3e51 100644 --- a/netwerk/cache2/CacheIndex.cpp +++ b/netwerk/cache2/CacheIndex.cpp @@ -18,7 +18,6 @@ #include "nsITimer.h" #include "mozilla/AutoRestore.h" #include -#include "mozilla/StaticPrefs_network.h" #include "mozilla/Telemetry.h" #include "mozilla/Unused.h" @@ -70,23 +69,6 @@ class FrecencyComparator { } // namespace -CacheIndexRecord::~CacheIndexRecord() { - if (!StaticPrefs::network_cache_frecency_array_check_enabled()) { - return; - } - - RefPtr index = CacheIndex::gInstance; - if (index) { - CacheIndex::sLock.AssertCurrentThreadOwns(); -#ifdef MOZ_DIAGNOSTIC_ASSERT_ENABLED - bool found = index->mFrecencyArray.FindAndRemoveRecord(this); - MOZ_DIAGNOSTIC_ASSERT(!found); -#else - Unused << index->mFrecencyArray.FindAndRemoveRecord(this); -#endif - } -} - /** * This helper class is responsible for keeping CacheIndex::mIndexStats and * CacheIndex::mFrecencyArray up to date. @@ -3399,10 +3381,6 @@ void CacheIndex::FrecencyArray::ReplaceRecord(CacheIndexRecord* aOldRecord, mRecs[idx] = aNewRecord; } -bool CacheIndex::FrecencyArray::FindAndRemoveRecord(CacheIndexRecord* aRecord) { - return mRecs.RemoveElement(aRecord); -} - void CacheIndex::FrecencyArray::SortIfNeeded() { const uint32_t kMaxUnsortedCount = 512; const uint32_t kMaxUnsortedPercent = 10; diff --git a/netwerk/cache2/CacheIndex.h b/netwerk/cache2/CacheIndex.h index e4875e60e011..a1ff65993374 100644 --- a/netwerk/cache2/CacheIndex.h +++ b/netwerk/cache2/CacheIndex.h @@ -101,8 +101,6 @@ struct CacheIndexRecord { mOnStopTime(kIndexTimeNotAvailable), mContentType(nsICacheEntry::CONTENT_TYPE_UNKNOWN), mFlags(0) {} - - ~CacheIndexRecord(); }; #pragma pack(pop) @@ -817,7 +815,6 @@ class CacheIndex final : public CacheFileIOListener, public nsIRunnable { friend class CacheIndexEntryAutoManage; friend class FileOpenHelper; friend class CacheIndexIterator; - friend struct CacheIndexRecord; virtual ~CacheIndex(); @@ -1190,7 +1187,6 @@ class CacheIndex final : public CacheFileIOListener, public nsIRunnable { void RemoveRecord(CacheIndexRecord* aRecord); void ReplaceRecord(CacheIndexRecord* aOldRecord, CacheIndexRecord* aNewRecord); - bool FindAndRemoveRecord(CacheIndexRecord* aRecord); void SortIfNeeded(); size_t Length() const { return mRecs.Length() - mRemovedElements; }