[not part of the build] Make nsICacheEntryDescriptor inherit from nsICacheEntryInfo

This commit is contained in:
darin%netscape.com 2001-03-14 01:11:14 +00:00
parent 3b054b6a2c
commit 3f44553e13
6 changed files with 26 additions and 44 deletions

View File

@ -24,56 +24,27 @@
* Darin Fisher <darin@netscape.com>
*/
#include "nsITransport.idl"
#include "nsICacheVisitor.idl"
#include "nsICache.idl"
interface nsISimpleEnumerator;
interface nsICacheListener;
interface nsITransport;
interface nsIFile;
[scriptable, uuid(49c1a11d-f5d2-4f09-8262-551e64908ada)]
interface nsICacheEntryDescriptor : nsISupports
interface nsICacheEntryDescriptor : nsICacheEntryInfo
{
/**
* Get the key identifying the cache entry.
* Set the time at which the cache entry should be considered invalid.
*/
readonly attribute string key;
void setExpirationTime(in PRTime expirationTime);
/**
* Get the number of times the cache entry has been opened.
* Set the cache entry data size. This will fail if the cache entry
* IS stream based.
*/
readonly attribute long fetchCount;
/**
* Get the last time the cache entry was opened.
*/
readonly attribute PRTime lastFetched;
/**
* Get the last time the cache entry was modified.
*/
readonly attribute PRTime lastModified;
/**
* Get the last time the cache entry was marked valid.
*/
readonly attribute PRTime lastValidated;
/**
* Get the expiration time of the cache entry.
*/
attribute PRTime expirationTime;
/**
* Find out whether or not the cache entry is stream based.
*/
boolean isStreamBased();
/**
* Get/set the cache entry data size. This attribute can only be set if
* the cache entry IS NOT stream based.
*/
attribute unsigned long dataSize;
void setDataSize(in unsigned long size);
/**
* Get a transport to the cache data. This will fail if the cache entry
@ -134,7 +105,7 @@ interface nsICacheEntryDescriptor : nsISupports
* Explicitly close the descriptor (optional).
*/
void close();
void close();
/**
* Methods for accessing meta data. Meta data is a table of key/value

View File

@ -129,13 +129,13 @@ interface nsICacheEntryInfo : nsISupports
*/
readonly attribute PRTime expirationTime;
/**
* Find out whether or not the cache entry is stream based.
*/
readonly attribute boolean streamBased;
/**
* Get the cache entry data size.
*/
readonly attribute unsigned long dataSize;
/**
* Find out whether or not the cache entry is stream based.
*/
boolean isStreamBased();
};

View File

@ -68,6 +68,13 @@ nsCacheEntryDescriptor::Create(nsCacheEntry * entry, nsCacheAccessMode accessGr
}
NS_IMETHODIMP
nsCacheEntryDescriptor::GetClientID(char ** result)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP
nsCacheEntryDescriptor::GetKey(char ** result)
{

View File

@ -28,6 +28,7 @@
#include "nsICacheEntryDescriptor.h"
#include "nsCacheEntry.h"
#include "nsIOutputStream.h"
#include "nsITransport.h"
class nsCacheEntryDescriptor :
public PRCList,
@ -36,6 +37,7 @@ class nsCacheEntryDescriptor :
public:
NS_DECL_ISUPPORTS
NS_DECL_NSICACHEENTRYDESCRIPTOR
NS_DECL_NSICACHEENTRYINFO
nsCacheEntryDescriptor(nsCacheEntry * entry, nsCacheAccessMode mode);
virtual ~nsCacheEntryDescriptor();

View File

@ -33,6 +33,7 @@
#include "nsIInputStream.h"
#include "nsIOutputStream.h"
#include "nsISupportsArray.h"
#include "nsITransport.h"
static const char DISK_CACHE_DEVICE_ID[] = { "disk" };
@ -531,7 +532,7 @@ NS_IMETHODIMP nsCacheEntryInfo::GetExpirationTime(PRTime *aExpirationTime)
return NS_OK;
}
NS_IMETHODIMP nsCacheEntryInfo::GetStreamBased(PRBool *aStreamBased)
NS_IMETHODIMP nsCacheEntryInfo::IsStreamBased(PRBool *aStreamBased)
{
*aStreamBased = PR_TRUE;
return NS_OK;

View File

@ -28,6 +28,7 @@
#include "nsIObserverService.h"
#include "nsIPref.h"
#include "nsICacheVisitor.h"
#include "nsITransport.h"
#include "signal.h"