diff --git a/mozilla/modules/libpr0n/src/imgCache.cpp b/mozilla/modules/libpr0n/src/imgCache.cpp index 18da4f33e7c..96c07f8ad79 100644 --- a/mozilla/modules/libpr0n/src/imgCache.cpp +++ b/mozilla/modules/libpr0n/src/imgCache.cpp @@ -211,7 +211,7 @@ PRBool imgCache::Get(nsIURI *aKey, PRBool aDoomIfExpired, imgRequest **aRequest, if (aDoomIfExpired) { PRUint32 expirationTime; entry->GetExpirationTime(&expirationTime); - if (expirationTime && (expirationTime <= SecondsFromPRTime(PR_Now()))) { + if (expirationTime <= SecondsFromPRTime(PR_Now())) { entry->Doom(); return PR_FALSE; } diff --git a/mozilla/netwerk/cache/src/nsCacheEntry.cpp b/mozilla/netwerk/cache/src/nsCacheEntry.cpp index 5cb02d1750c..3131215e25c 100644 --- a/mozilla/netwerk/cache/src/nsCacheEntry.cpp +++ b/mozilla/netwerk/cache/src/nsCacheEntry.cpp @@ -40,7 +40,7 @@ nsCacheEntry::nsCacheEntry(nsCString * key, : mKey(key), mFetchCount(0), mLastFetched(0), - mExpirationTime(0), + mExpirationTime(NO_EXPIRATION_TIME), mFlags(0), mDataSize(0), mMetaSize(0), diff --git a/mozilla/netwerk/cache/src/nsCacheEntry.h b/mozilla/netwerk/cache/src/nsCacheEntry.h index d954d9ed101..a373b9adb51 100644 --- a/mozilla/netwerk/cache/src/nsCacheEntry.h +++ b/mozilla/netwerk/cache/src/nsCacheEntry.h @@ -40,6 +40,8 @@ class nsCacheMetaData; class nsCacheRequest; class nsCacheEntryDescriptor; +#define NO_EXPIRATION_TIME 0xFFFFFFFF + /****************************************************************************** * nsCacheEntry *******************************************************************************/ diff --git a/mozilla/netwerk/cache/src/nsCacheService.cpp b/mozilla/netwerk/cache/src/nsCacheService.cpp index 2d72be463bc..a125cd85791 100644 --- a/mozilla/netwerk/cache/src/nsCacheService.cpp +++ b/mozilla/netwerk/cache/src/nsCacheService.cpp @@ -860,8 +860,7 @@ nsCacheService::ActivateEntry(nsCacheRequest * request, if (entry && ((request->AccessRequested() == nsICache::ACCESS_WRITE) || - (entry->mExpirationTime && - entry->mExpirationTime <= SecondsFromPRTime(PR_Now()) && + (entry->mExpirationTime <= SecondsFromPRTime(PR_Now()) && request->WillDoomEntriesIfExpired()))) { // this is FORCE-WRITE request or the entry has expired diff --git a/mozilla/netwerk/cache/src/nsMemoryCacheDevice.cpp b/mozilla/netwerk/cache/src/nsMemoryCacheDevice.cpp index 3f4f5d83f71..dd92fec7d0d 100644 --- a/mozilla/netwerk/cache/src/nsMemoryCacheDevice.cpp +++ b/mozilla/netwerk/cache/src/nsMemoryCacheDevice.cpp @@ -326,7 +326,7 @@ int nsMemoryCacheDevice::EvictionList(nsCacheEntry * entry, PRUint32 deltaSize) { PRUint32 size = entry->Size() + deltaSize; - if ((size > mEvictionThreshold) || (entry->ExpirationTime() != 0)) + if ((size > mEvictionThreshold) || (entry->ExpirationTime() != NO_EXPIRATION_TIME)) return mostLikelyToEvict; return leastLikelyToEvict; diff --git a/mozilla/netwerk/protocol/http/src/nsHttpChannel.cpp b/mozilla/netwerk/protocol/http/src/nsHttpChannel.cpp index 0c5f7f01f57..cf7a5812fde 100644 --- a/mozilla/netwerk/protocol/http/src/nsHttpChannel.cpp +++ b/mozilla/netwerk/protocol/http/src/nsHttpChannel.cpp @@ -743,7 +743,7 @@ nsHttpChannel::UpdateExpirationTime() { NS_ENSURE_TRUE(mResponseHead, NS_ERROR_FAILURE); - PRUint32 expirationTime = 1; // this can't be 0 unless bug 120833 is fixed + PRUint32 expirationTime = 0; if (!mResponseHead->MustValidate()) { PRUint32 freshnessLifetime = 0; nsresult rv; diff --git a/mozilla/widget/src/cocoa/nsSound.cpp b/mozilla/widget/src/cocoa/nsSound.cpp index f116b0f3621..95f45578849 100644 --- a/mozilla/widget/src/cocoa/nsSound.cpp +++ b/mozilla/widget/src/cocoa/nsSound.cpp @@ -408,7 +408,7 @@ nsSound::PutSoundInCache(nsIChannel* inChannel, PRUint32 inDataSize, nsISupports } } - if (expirationTime == 0) + if (expirationTime == PRUint32(-1)) // no expiration time (never expires) { // set it to some reasonable default, like now + 24 hours expirationTime = SecondsFromPRTime(PR_Now()) + 60 * 60 * 24; diff --git a/mozilla/widget/src/mac/nsSound.cpp b/mozilla/widget/src/mac/nsSound.cpp index 515adfd56df..f5878b9f465 100644 --- a/mozilla/widget/src/mac/nsSound.cpp +++ b/mozilla/widget/src/mac/nsSound.cpp @@ -408,7 +408,7 @@ nsSound::PutSoundInCache(nsIChannel* inChannel, PRUint32 inDataSize, nsISupports } } - if (expirationTime == 0) + if (expirationTime == PRUint32(-1)) // no expiration time (never expires) { // set it to some reasonable default, like now + 24 hours expirationTime = SecondsFromPRTime(PR_Now()) + 60 * 60 * 24;