mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Backed out changeset 98fa8afd9169 (bug 1038357) for causing merge conflicts due startup crash backout
This commit is contained in:
parent
e2716d6158
commit
3452cb011a
@ -1067,42 +1067,13 @@ void CacheStorageService::ForceEntryValidFor(nsACString &aCacheEntryKey,
|
||||
{
|
||||
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)
|
||||
|
@ -280,8 +280,6 @@ private:
|
||||
bool aReplace,
|
||||
CacheEntryHandle** aResult);
|
||||
|
||||
void ForcedValidEntriesPrune(TimeStamp &now);
|
||||
|
||||
static CacheStorageService* sSelf;
|
||||
|
||||
mozilla::Mutex mLock;
|
||||
|
Loading…
Reference in New Issue
Block a user