The nsICacheService interface handles visiting and evicting entries operations along with the creating cache sessions and creating temporary client ID's operations for offline caching.
nsICacheService is defined in netwerk/cache/public/nsICacheService.idl
. It is scriptable
and
unfrozen (hasn't changed since Mozilla 1.9)
.
Inherits from: nsISupports
nsICacheSession createSession(in string clientID, in nsCacheStoragePolicy storagePolicy, in boolean streamBased);
|
void visitEntries(in nsICacheVisitor visitor);
|
void evictEntries(in nsCacheStoragePolicy storagePolicy);
|
ACString createTemporaryClientID(in nsCacheStoragePolicy storagePolicy);
|
This method creates a cache session.
A cache session represents a client's access into the cache. The cache session is not "owned" by the cache service. Hence, it is possible to create duplicate cache sessions. Entries created by a cache session are invisible to other cache sessions, unless the cache sessions are equivalent.
nsICacheSession createSession( in string clientID, in nsCacheStoragePolicy storagePolicy, in boolean streamBased );
storagePolicy must be consistent with the value of this field. For example, a non-stream-based cache entry can only have a storage policy of STORE_IN_MEMORY.
This method visits entries stored in the cache. Used to implement the about:cache URI.
void visitEntries( in nsICacheVisitor visitor );
This method evicts all entries in all devices implied by the storage policy.
void evictEntries( in nsCacheStoragePolicy storagePolicy );
This method creates and returns a unique, temporary cache client ID.
This is used by the offline cache. The offline cache lets clients accumulate entries in a temporary client and merge them in as a group using nsIOfflineCacheSession
mergeTemporaryClient() method.
ACString createTemporaryClientID( in nsCacheStoragePolicy storagePolicy );
Page last modified 16:31, 5 Aug 2008 by Varmaa