mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-03 18:47:53 +00:00
Added MarkDoomed(), MarkStreamData(), and set StreamData in constructor.
This commit is contained in:
parent
13d79d0bf7
commit
510792cb80
7
netwerk/cache/src/nsCacheEntry.cpp
vendored
7
netwerk/cache/src/nsCacheEntry.cpp
vendored
@ -31,7 +31,9 @@
|
||||
#include "nsICacheService.h"
|
||||
|
||||
#define ONE_YEAR (PR_USEC_PER_SEC * 60 * 60 * 24 * 365)
|
||||
nsCacheEntry::nsCacheEntry(nsCString * key, nsCacheStoragePolicy storagePolicy)
|
||||
nsCacheEntry::nsCacheEntry(nsCString * key,
|
||||
PRBool streamBased,
|
||||
nsCacheStoragePolicy storagePolicy)
|
||||
: mKey(key),
|
||||
mFetchCount(0),
|
||||
mLastValidated(LL_ZERO),
|
||||
@ -48,6 +50,8 @@ nsCacheEntry::nsCacheEntry(nsCString * key, nsCacheStoragePolicy storagePolicy)
|
||||
PR_INIT_CLIST(&mDescriptorQ);
|
||||
|
||||
mLastFetched = PR_Now();
|
||||
|
||||
if (streamBased) MarkStreamBased();
|
||||
|
||||
if ((storagePolicy == nsICache::STORE_IN_MEMORY) ||
|
||||
(storagePolicy == nsICache::STORE_ANYWHERE)) {
|
||||
@ -112,6 +116,7 @@ nsCacheEntry::SetMetaDataElement( const nsAReadableCString& key,
|
||||
void
|
||||
nsCacheEntry::MarkValid()
|
||||
{
|
||||
//** bind if not bound
|
||||
//** convert pending requests to descriptors, etc.
|
||||
mFlags |= eValidMask;
|
||||
}
|
||||
|
6
netwerk/cache/src/nsCacheEntry.h
vendored
6
netwerk/cache/src/nsCacheEntry.h
vendored
@ -44,7 +44,9 @@ class nsCacheEntry
|
||||
{
|
||||
public:
|
||||
|
||||
nsCacheEntry(nsCString * key, nsCacheStoragePolicy storagePolicy);
|
||||
nsCacheEntry(nsCString * key,
|
||||
PRBool streamBased,
|
||||
nsCacheStoragePolicy storagePolicy);
|
||||
~nsCacheEntry();
|
||||
|
||||
nsCString * Key(void) { return mKey; }
|
||||
@ -96,9 +98,11 @@ public:
|
||||
|
||||
};
|
||||
|
||||
void MarkDoomed() { mFlags |= eDoomedMask; }
|
||||
void MarkEntryDirty() { mFlags |= eEntryDirtyMask; }
|
||||
void MarkDataDirty() { mFlags |= eDataDirtyMask; }
|
||||
void MarkMetaDataDirty() { mFlags |= eMetaDataDirtyMask; }
|
||||
void MarkStreamData() { mFlags |= eStreamDataMask; }
|
||||
void MarkActive() { mFlags |= eActiveMask; }
|
||||
void MarkInactive() { mFlags &= ~eActiveMask; }
|
||||
void MarkValid();
|
||||
|
Loading…
Reference in New Issue
Block a user