nsISupports
Last changed in Gecko 2.0 (Firefox 4 / Thunderbird 3.3 / SeaMonkey 2.1)Each application cache has a unique client ID for use with nsICacheService.openSession()
method, to access the cache's entries.
Each entry in the cache can be marked with a set of types, specified in the Constants section.
All application caches with the same group ID belong to a cache group. Each group has one "active" cache that will service future loads. Inactive caches are removed from the cache when no longer referenced.
void activate(); |
void addNamespaces(in nsIArray namespaces); |
void discard(); |
void gatherEntries(in PRUint32 typeBits, out unsigned long count, [array, size_is(count)] out string keys); |
nsIApplicationCacheNamespace getMatchingNamespace(in ACString key); |
unsigned long getTypes(in ACString key); |
void initAsHandle(in ACString groupId, in ACString clientId); |
void markEntry(in ACString key, in unsigned long typeBits); |
void unmarkEntry(in ACString key, in unsigned long typeBits); |
Attribute | Type | Description |
active | boolean | true if the cache is the active cache for this group, otherwise false . Read only. |
clientID | ACString | The client ID for this application cache. Clients can open a session with nsICacheService.createSession() using this client ID and a storage policy of STORE_OFFLINE to access this cache. Read only. |
groupID | ACString | The group ID for this cache group. This is the URI of the cache manifest file. Read only. |
usage | unsigned long | The disk usage of the application cache, in bytes. Read only. |
Constant | Value | Description |
ITEM_MANIFEST | 1 | This item is the application manifest. |
ITEM_EXPLICIT | 2 | This item was explicitly listed in the application manifest. |
ITEM_IMPLICIT | 4 | This item was navigated to in a top level browsing context, and named this cache's group as its manifest. |
ITEM_DYNAMIC | 8 | This item was added to the cache using the dynamic scripting API. |
ITEM_FOREIGN | 16 | This item was listed in the application manifest, but named a different cache group as its manifest. |
ITEM_FALLBACK | 32 | This item was listed as a fallback entry. |
ITEM_OPPORTUNISTIC | 64 | This item matched an opportunistic cache namespace and was cached for that reason. |
Makes this cache the active application cache for this group. Future loads associated with this group will come from this cache. Other caches from this cache group will be deactivated.
void activate();
None.
Add a set of namespace entries to the application cache.
void addNamespaces( in nsIArray namespaces );
namespaces
nsIArray
of nsIApplicationCacheNamespace
objects describing the namespaces to add to the cache.Discards this application cache. This removes all resources it has cached. If this is the active application cache for the group, the group is removed.
void discard();
None.
Returns a list of entries in the cache whose type matches one or more of the specified types.
void gatherEntries( in PRUint32 typeBits, out unsigned long count, [array, size_is(count)] out string keys );
typeBits
count
keys
typeBits
.Returns the most specific namespace matching a given key.
nsIApplicationCacheNamespace getMatchingNamespace( in ACString key );
key
An nsIApplicationCacheNamespace
object describing the most specific namespace matching the given key
.
Gets the types for a given entry in the cache.
unsigned long getTypes( in ACString key );
key
A bit field indicating the entry's types. See Constants for a list of types.
Init this application cache instance to just hold the group ID and the client ID to work just as a handle to the real cache. Used on content process to simplify the application cache code.
void initAsHandle( in ACString groupId, in ACString clientId );
groupId
clientId
Adds item types to a given entry.
void markEntry( in ACString key, in unsigned long typeBits );
key
typeBits
Removes types from a given entry. If the resulting entry has no types left, the entry is removed.
void unmarkEntry( in ACString key, in unsigned long typeBits );
key
typeBits