Backed out changeset 98fa8afd9169 (bug 1038357) for causing merge conflicts due startup crash backout
authorCarsten "Tomcat" Book <cbook@mozilla.com>
Mon, 21 Jul 2014 15:15:20 +0200
changeset 217192 42935adf0c7031cde1f913e1eeb5c9691141d53a
parent 217191 f09caa4ea7c5335b679b8a9c60a5ca5b8fb90b76
child 217193 c9b967d0e5dad1a4d81d956fd1f3b86b005cd5e7
child 218230 40954106dc7aa935166826690d1d80dec0803bd8
push id515
push userraliiev@mozilla.com
push dateMon, 06 Oct 2014 12:51:51 +0000
treeherdermozilla-release@267c7a481bef [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1038357
milestone33.0a1
backs out98fa8afd916933a650dcf670873f9ef78c33b3c9
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
Backed out changeset 98fa8afd9169 (bug 1038357) for causing merge conflicts due startup crash backout
netwerk/cache2/CacheStorageService.cpp
netwerk/cache2/CacheStorageService.h
--- a/netwerk/cache2/CacheStorageService.cpp
+++ b/netwerk/cache2/CacheStorageService.cpp
@@ -1062,52 +1062,23 @@ bool CacheStorageService::IsForcedValidE
 
 // Allows a cache entry to be loaded directly from cache without further
 // validation - see nsICacheEntry.idl for further details
 void CacheStorageService::ForceEntryValidFor(nsACString &aCacheEntryKey,
                                              uint32_t aSecondsToTheFuture)
 {
   mozilla::MutexAutoLock lock(mLock);
 
-  TimeStamp now = TimeStamp::NowLoRes();
-  ForcedValidEntriesPrune(now);
-
   // This will be the timeout
-  TimeStamp validUntil = now + TimeDuration::FromSeconds(aSecondsToTheFuture);
+  TimeStamp validUntil = TimeStamp::NowLoRes() +
+    TimeDuration::FromSeconds(aSecondsToTheFuture);
 
   mForcedValidEntries.Put(aCacheEntryKey, validUntil);
 }
 
-namespace { // anon
-
-PLDHashOperator PruneForcedValidEntries(
-  const nsACString& aKey, TimeStamp& aTimeStamp, void* aClosure)
-{
-  TimeStamp* now = static_cast<TimeStamp*>(aClosure);
-  if (aTimeStamp < *now) {
-    return PL_DHASH_REMOVE;
-  }
-
-  return PL_DHASH_NEXT;
-}
-
-} // anon
-
-// Cleans out the old entries in mForcedValidEntries
-void CacheStorageService::ForcedValidEntriesPrune(TimeStamp &now)
-{
-  static TimeDuration const oneMinute = TimeDuration::FromSeconds(60);
-  static TimeStamp dontPruneUntil = now + oneMinute;
-  if (now < dontPruneUntil)
-    return;
-
-  mForcedValidEntries.Enumerate(PruneForcedValidEntries, &now);
-  dontPruneUntil = now + oneMinute;
-}
-
 void
 CacheStorageService::OnMemoryConsumptionChange(CacheMemoryConsumer* aConsumer,
                                                uint32_t aCurrentMemoryConsumption)
 {
   LOG(("CacheStorageService::OnMemoryConsumptionChange [consumer=%p, size=%u]",
     aConsumer, aCurrentMemoryConsumption));
 
   uint32_t savedMemorySize = aConsumer->mReportedMemoryConsumption;
--- a/netwerk/cache2/CacheStorageService.h
+++ b/netwerk/cache2/CacheStorageService.h
@@ -275,18 +275,16 @@ private:
   nsresult AddStorageEntry(nsCSubstring const& aContextKey,
                            nsIURI* aURI,
                            const nsACString & aIdExtension,
                            bool aWriteToDisk,
                            bool aCreateIfNotExist,
                            bool aReplace,
                            CacheEntryHandle** aResult);
 
-  void ForcedValidEntriesPrune(TimeStamp &now);
-
   static CacheStorageService* sSelf;
 
   mozilla::Mutex mLock;
 
   // Tracks entries that may be forced valid.
   nsDataHashtable<nsCStringHashKey, TimeStamp> mForcedValidEntries;
 
   bool mShutdown;