Public Member Functions | Public Attributes

nsIApplicationCache Interface Reference

Application caches store resources for offline use. More...

import "nsIApplicationCache.idl";

List of all members.

Public Member Functions

void activate ()
 Makes this cache the active application cache for this group.
void discard ()
 Discard this application cache.
void markEntry (in ACString key, in unsigned long typeBits)
 Adds item types to a given entry.
void unmarkEntry (in ACString key, in unsigned long typeBits)
 Removes types from a given entry.
unsigned long getTypes (in ACString key)
 Gets the types for a given entry.
void gatherEntries (in PRUint32 typeBits, out unsigned long count,[array, size_is(count)] out string keys)
 Returns any entries in the application cache whose type matches one or more of the bits in typeBits.
void addNamespaces (in nsIArray namespaces)
 Add a set of namespace entries to the application cache.
nsIApplicationCacheNamespace getMatchingNamespace (in ACString key)
 Get the most specific namespace matching a given key.

Public Attributes

const unsigned long ITEM_MANIFEST = 1 << 0
 Entries in an application cache can be marked as one or more of the following types.
const unsigned long ITEM_EXPLICIT = 1 << 1
const unsigned long ITEM_IMPLICIT = 1 << 2
const unsigned long ITEM_DYNAMIC = 1 << 3
const unsigned long ITEM_FOREIGN = 1 << 4
const unsigned long ITEM_FALLBACK = 1 << 5
const unsigned long ITEM_OPPORTUNISTIC = 1 << 6
readonly attribute ACString groupID
 The group ID for this cache group.
readonly attribute ACString clientID
 The client ID for this application cache.
readonly attribute boolean active
 TRUE if the cache is the active cache for this group.
readonly attribute unsigned long usage
 The disk usage of the application cache, in bytes.

Detailed Description

Application caches store resources for offline use.

Each application cache has a unique client ID for use with nsICacheService::openSession() to access the cache's entries.

Each entry in the application cache can be marked with a set of types, as discussed in the WHAT-WG offline applications specification.

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 will be removed from the cache when they are no longer referenced.


Member Function Documentation

void nsIApplicationCache::activate (  ) 

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 nsIApplicationCache::addNamespaces ( in nsIArray  namespaces  ) 

Add a set of namespace entries to the application cache.

Parameters:
namespaces An nsIArray of nsIApplicationCacheNamespace entries.
void nsIApplicationCache::discard (  ) 

Discard this application cache.

Removes all cached resources for this cache. If this is the active application cache for the group, the group will be removed.

void nsIApplicationCache::gatherEntries ( in PRUint32  typeBits,
out unsigned long  count,
[array, size_is(count)] out string  keys 
)

Returns any entries in the application cache whose type matches one or more of the bits in typeBits.

nsIApplicationCacheNamespace nsIApplicationCache::getMatchingNamespace ( in ACString  key  ) 

Get the most specific namespace matching a given key.

unsigned long nsIApplicationCache::getTypes ( in ACString  key  ) 

Gets the types for a given entry.

void nsIApplicationCache::markEntry ( in ACString  key,
in unsigned long  typeBits 
)

Adds item types to a given entry.

void nsIApplicationCache::unmarkEntry ( in ACString  key,
in unsigned long  typeBits 
)

Removes types from a given entry.

If the resulting entry has no types left, the entry is removed.


Member Data Documentation

TRUE if the cache is the active cache for this group.

readonly attribute ACString nsIApplicationCache::clientID

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.

readonly attribute ACString nsIApplicationCache::groupID

The group ID for this cache group.

This is the URI of the manifest file.

const unsigned long nsIApplicationCache::ITEM_DYNAMIC = 1 << 3
const unsigned long nsIApplicationCache::ITEM_EXPLICIT = 1 << 1
const unsigned long nsIApplicationCache::ITEM_FALLBACK = 1 << 5
const unsigned long nsIApplicationCache::ITEM_FOREIGN = 1 << 4
const unsigned long nsIApplicationCache::ITEM_IMPLICIT = 1 << 2
const unsigned long nsIApplicationCache::ITEM_MANIFEST = 1 << 0

Entries in an application cache can be marked as one or more of the following types.

const unsigned long nsIApplicationCache::ITEM_OPPORTUNISTIC = 1 << 6
readonly attribute unsigned long nsIApplicationCache::usage

The disk usage of the application cache, in bytes.


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