Public Member Functions | Public Attributes

nsICacheSession Interface Reference

import "nsICacheSession.idl";

List of all members.

Public Member Functions

nsICacheEntryDescriptor openCacheEntry (in ACString key, in nsCacheAccessMode accessRequested, in boolean blockingMode)
 A cache session can only give out one descriptor with WRITE access to a given cache entry at a time.
void asyncOpenCacheEntry (in ACString key, in nsCacheAccessMode accessRequested, in nsICacheListener listener)
 Asynchronous cache access.
void evictEntries ()
 Evict all entries for this session's clientID according to its storagePolicy.
PRBool isStorageEnabled ()
 Return whether any of the cache devices implied by the session storage policy are currently enabled for instantiation if they don't already exist.

Public Attributes

attribute PRBool doomEntriesIfExpired
 Expired entries will be doomed or evicted if this attribute is set to true.

Member Function Documentation

void nsICacheSession::asyncOpenCacheEntry ( in ACString  key,
in nsCacheAccessMode  accessRequested,
in nsICacheListener  listener 
)

Asynchronous cache access.

Does not block the calling thread. Instead, the listener will be notified when the descriptor is available.

void nsICacheSession::evictEntries (  ) 

Evict all entries for this session's clientID according to its storagePolicy.

PRBool nsICacheSession::isStorageEnabled (  ) 

Return whether any of the cache devices implied by the session storage policy are currently enabled for instantiation if they don't already exist.

nsICacheEntryDescriptor nsICacheSession::openCacheEntry ( in ACString  key,
in nsCacheAccessMode  accessRequested,
in boolean  blockingMode 
)

A cache session can only give out one descriptor with WRITE access to a given cache entry at a time.

Until the client calls MarkValid on its descriptor, other attempts to open the same cache entry will block. Synchronous cache access. This returns a unique descriptor each time it is called, even if the same key is specified. When called by multiple threads for write access, only one writable descriptor will be granted. If 'blockingMode' is set to false, it will return NS_ERROR_CACHE_WAIT_FOR_VALIDATION rather than block when another descriptor has been given WRITE access but hasn't validated the entry yet.


Member Data Documentation

Expired entries will be doomed or evicted if this attribute is set to true.

If false, expired entries will be returned (useful for offline- mode and clients, such as HTTP, that can update the valid lifetime of cached content). This attribute defaults to true.


The documentation for this interface was generated from the following file: