Added MarkDoomed(), MarkStreamData(), and set StreamData in constructor.

This commit is contained in:
gordon%netscape.com 2001-02-28 03:54:16 +00:00
parent 13d79d0bf7
commit 510792cb80
2 changed files with 11 additions and 2 deletions

View File

@ -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;
}

View File

@ -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();