Readonly
altReadonly
altReturns the type of the saved alt data.
Readonly
cacheThe unique ID for every nsICacheEntry instance, which can be used to check whether two pieces of information are from the same nsICacheEntry instance.
Readonly
dataReturns the length of data this entry holds.
NS_ERROR_IN_PROGRESS when the write is still in progress.
Readonly
diskReturns the size in kilobytes used to store the cache entry on disk.
Readonly
expirationGet the expiration time of the cache entry (in seconds since the Epoch).
Readonly
fetchGet the number of times the cache entry has been opened.
Readonly
isThe state variable for whether this entry is currently forced valid. Defaults to false for normal cache validation behavior, and will return true if the number of seconds set by forceValidFor() has yet to be reached.
Readonly
keyGet the key identifying the cache entry.
Readonly
lastGet the last time the cache entry was opened (in seconds since the Epoch).
Readonly
lastGet the last time the cache entry was modified (in seconds since the Epoch).
Readonly
loadGet the nsILoadContextInfo of the cache entry
Readonly
onGet the last network response times for onStartReqeust/onStopRequest (in ms).
Readonly
onReadonly
persistentWhether the entry is memory/only or persisted to disk. Note: private browsing entries are reported as persistent for consistency while are not actually persisted to disk.
Get/set security info on the cache entry for this descriptor.
Readonly
storageGet the size of the cache entry data, as stored. This may differ from the entry's dataSize, if the entry is compressed.
Optional
aInstancePtr: objectA run time mechanism for interface discovery.
NS_OK if the interface is supported by the associated instance, NS_NOINTERFACE if it is not.
aInstancePtr must not be null.
[in] A requested interface IID
[out] A pointer to an interface pointer to receive the result.
The following methods might be added to some nsICacheEntryInternal interface since we want to remove them as soon as the old cache backend is completely removed.
FOR BACKWARD COMPATIBILITY ONLY When the old cache backend is eventually removed, this method can be removed too.
In the new backend: this method is no-op In the old backend: this method delegates to nsICacheEntryDescriptor.close()
Explicitly tell the cache backend this consumer is no longer going to modify this cache entry data or metadata. In case the consumer was responsible to either of writing the cache entry or revalidating it, calling this method reverts the state to initial (as never written) or as not-validated and immediately notifies the next consumer in line waiting for this entry. This is the way to prevent deadlocks when someone else than the responsible channel references the cache entry being in a non-written or revalidating state.
This method is intended to override the per-spec cache validation decisions for a duration specified in seconds. The current state can be examined with isForcedValid (see below). This value is not persisted, so it will not survive session restart. Cache entries that are forced valid will not be evicted from the cache for the duration of forced validity. This means that there is a potential problem if the number of forced valid entries grows to take up more space than the cache size allows.
NOTE: entries that have been forced valid will STILL be ignored by HTTP channels if they have expired AND the resource in question requires validation after expiring. This is to avoid using known-stale content.
the number of seconds the default cache validation behavior will be overridden before it returns to normal
FOR BACKWARD COMPATIBILITY ONLY / KINDA HACK
true when write access is acquired for this entry, false otherwise
Consumer indicates whether write to the entry is allowed for it. Depends on implementation how the flag is handled.
This method gets called to mark the actual use of the forced-valid entry. This is necessary for telemetry, so when the entry eventually gets evicted we can report whether it was ever used or not. If the entry was not forced-valid, then this operation has no effect.
Opens and returns an input stream that can be used to read the alternative representation previously saved in the cache. If this call is made while writing alt-data is still in progress, it is still possible to read content from the input stream as it's being written.
Opens and returns an output stream that a consumer may use to save an alternate representation of the data.
If there is alt-data already saved, it will be overwritten.
type of the alternative data representation
Predicted size of the data that will be written. It's used to decide whether the resulting entry would exceed size limit, in which case an error is thrown. If the size isn't known in advance, -1 should be passed.
Open blocking input stream to cache data. Use the stream transport service to asynchronously read this stream on a background thread. The returned stream MAY implement nsISeekableStream.
non-blocking, buffered input stream.
read starting from this offset into the cached data. an offset beyond the end of the stream has undefined consequences.
Open non-blocking output stream to cache data. The returned stream MAY implement nsISeekableStream.
If opening an output stream to existing cached data, the data will be truncated to the specified offset.
blocking, buffered output stream.
write starting from this offset into the cached data. an offset beyond the end of the stream has undefined consequences.
Predicted size of the data that will be written. It's used to decide whether the resulting entry would exceed size limit, in which case an error is thrown. If the size isn't known in advance, -1 should be passed.
Doom this entry and open a new, empty, entry for write. Consumer has to exchange the entry this method is called on for the newly created. Used on 200 responses to conditional requests.
whether the entry is to be created as memory/only regardless how the entry being recreated persistence is set
Called by consumer upon 304/206 response from the server. This marks the entry content as positively revalidated. Consumer uses this method after the consumer has returned ENTRY_NEEDS_REVALIDATION result from onCacheEntryCheck and after successfull revalidation with the server.
Obtain the list of metadata keys this entry keeps.
NOTE: The callback is invoked under the CacheFile's lock. It means there should not be made any calls to the entry from the visitor and if the values need to be processed somehow, it's better to cache them and process outside the callback.
Generated using TypeDoc
Returns the length of data this entry holds.
Throws