Interface nsICacheStorageType

Representation of a cache storage. There can be just-in-mem, in-mem+on-disk, in-mem+on-disk+app-cache or just a specific app-cache storage.

Hierarchy

Methods

  • Increases the reference count for this interface. The associated instance will not be deleted unless the reference count is returned to zero.

    Returns

    The resulting reference count.

    Returns number

  • Parameters

    • aIID: object
    • Optional aInstancePtr: object

    Returns any

  • A run time mechanism for interface discovery.

    Returns

    NS_OK if the interface is supported by the associated instance, NS_NOINTERFACE if it is not.

    aInstancePtr must not be null.

    Parameters

    • aIID: object

      [in] A requested interface IID

    • aInstancePtr: object

      [out] A pointer to an interface pointer to receive the result.

    Returns void

  • Decreases the reference count for this interface. Generally, if the reference count returns to zero, the associated instance is deleted.

    Returns

    The resulting reference count.

    Returns number

  • Asynchronously removes an entry belonging to the URI from the cache.

    Parameters

    • aURI: nsIURI
    • aIdExtension: string
    • aCallback: nsICacheEntryDoomCallback

    Returns void

  • Asynchronously removes all cached entries under this storage. NOTE: Disk storage also evicts memory storage.

    Parameters

    • aCallback: nsICacheEntryDoomCallback

    Returns void

  • Asynchronously opens a cache entry for the specified URI. Result is fetched asynchronously via the callback.

    Parameters

    • aURI: nsIURI

      The URI to search in cache or to open for writting.

    • aIdExtension: string

      Any string that will extend (distinguish) the entry. Two entries with the same aURI but different aIdExtension will be comletely different entries. If you don't know what aIdExtension should be leave it empty.

    • aFlags: uint32_t

      OPEN_NORMALLY - open cache entry normally for read and write OPEN_TRUNCATE - delete any existing entry before opening it OPEN_READONLY - don't create an entry if there is none OPEN_PRIORITY - give this request a priority over others OPEN_BYPASS_IF_BUSY - backward compatibility only, LOAD_BYPASS_LOCAL_CACHE_IF_BUSY CHECK_MULTITHREADED - onCacheEntryCheck may be called on any thread, consumer implementation is thread-safe

    • aCallback: nsICacheEntryOpenCallback

      The consumer that receives the result. IMPORTANT: The callback may be called sooner the method returns.

    Returns void

  • Visits the storage and its entries. NOTE: Disk storage also visits memory storage.

    Parameters

    • aVisitor: nsICacheStorageVisitor
    • aVisitEntries: boolean

    Returns void

  • Synchronously check on existance of an entry. In case of disk entries this uses information from the cache index. When the index data are not up to date or index is still building, NS_ERROR_NOT_AVAILABLE is thrown. The same error may throw any storage implementation that cannot determine entry state without blocking the caller.

    Parameters

    • aURI: nsIURI
    • aIdExtension: string

    Returns boolean

  • Synchronously check on existance of alternative data and size of the content. When the index data are not up to date or index is still building, NS_ERROR_NOT_AVAILABLE is thrown. The same error may throw any storage implementation that cannot determine entry state without blocking the caller.

    Parameters

    • aURI: nsIURI
    • aIdExtension: string
    • aHasAltData: bool
    • aSizeInKB: uint32_t

    Returns void

  • Immediately opens a new and empty cache entry in the storage, any existing entries are immediately doomed. This is similar to the recreate() method on nsICacheEntry.

    Storage may not implement this method and throw NS_ERROR_NOT_IMPLEMENTED. In that case consumer must use asyncOpen with OPEN_TRUNCATE flag and get the new entry via a callback.

    See

    • asyncOpenURI
    • asyncOpenURI

    Parameters

    • aURI: nsIURI
    • aIdExtension: string

    Returns nsICacheEntry

Generated using TypeDoc