Struct xpcom::interfaces::nsICacheEntry
[−]
[src]
#[repr(C)]pub struct nsICacheEntry { /* fields omitted */ }
interface nsICacheEntry : nsISupports
Methods
impl nsICacheEntry
[src]
pub fn coerce<T: nsICacheEntryCoerce>(&self) -> &T
[src]
Cast this nsICacheEntry
to one of its base interfaces.
impl nsICacheEntry
[src]
pub const NO_EXPIRATION_TIME: i64
NO_EXPIRATION_TIME: i64 = 4294967295
/**
* Placeholder for the initial value of expiration time.
*/
pub unsafe fn GetKey(&self, aKey: &mut nsACString) -> nsresult
[src]
/**
* Get the key identifying the cache entry.
*/
readonly attribute ACString key;
pub unsafe fn GetCacheEntryId(&self, aCacheEntryId: *mut uint64_t) -> nsresult
[src]
/**
* The unique ID for every nsICacheEntry instance, which can be used to check
* whether two pieces of information are from the same nsICacheEntry instance.
*/
readonly attribute uint64_t cacheEntryId;
pub unsafe fn GetPersistent(&self, aPersistent: *mut bool) -> nsresult
[src]
/**
* Whether 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.
*/
readonly attribute boolean persistent;
pub unsafe fn GetFetchCount(&self, aFetchCount: *mut int32_t) -> nsresult
[src]
/**
* Get the number of times the cache entry has been opened.
*/
readonly attribute long fetchCount;
pub unsafe fn GetLastFetched(&self, aLastFetched: *mut uint32_t) -> nsresult
[src]
/**
* Get the last time the cache entry was opened (in seconds since the Epoch).
*/
readonly attribute uint32_t lastFetched;
pub unsafe fn GetLastModified(&self, aLastModified: *mut uint32_t) -> nsresult
[src]
/**
* Get the last time the cache entry was modified (in seconds since the Epoch).
*/
readonly attribute uint32_t lastModified;
pub unsafe fn GetExpirationTime(
&self,
aExpirationTime: *mut uint32_t
) -> nsresult
[src]
&self,
aExpirationTime: *mut uint32_t
) -> nsresult
/**
* Get the expiration time of the cache entry (in seconds since the Epoch).
*/
readonly attribute uint32_t expirationTime;
pub unsafe fn SetExpirationTime(&self, expirationTime: uint32_t) -> nsresult
[src]
/**
* Set the time at which the cache entry should be considered invalid (in
* seconds since the Epoch).
*/
void setExpirationTime (in uint32_t expirationTime);
pub unsafe fn GetOnStartTime(&self, aOnStartTime: *mut uint64_t) -> nsresult
[src]
/**
* Get the last network response times for onStartReqeust/onStopRequest (in ms).
* @throws
* - NS_ERROR_NOT_AVAILABLE if onStartTime/onStopTime does not exist.
*/
readonly attribute uint64_t onStartTime;
pub unsafe fn GetOnStopTime(&self, aOnStopTime: *mut uint64_t) -> nsresult
[src]
readonly attribute uint64_t onStopTime;
pub unsafe fn SetNetworkTimes(
&self,
onStartTime: uint64_t,
onStopTime: uint64_t
) -> nsresult
[src]
&self,
onStartTime: uint64_t,
onStopTime: uint64_t
) -> nsresult
/**
* Set the network response times for onStartReqeust/onStopRequest (in ms).
*/
void setNetworkTimes (in uint64_t onStartTime, in uint64_t onStopTime);
pub unsafe fn ForceValidFor(&self, aSecondsToTheFuture: uint32_t) -> nsresult
[src]
/**
* 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.
*
* @param aSecondsToTheFuture
* the number of seconds the default cache validation behavior will be
* overridden before it returns to normal
*/
void forceValidFor (in unsigned long aSecondsToTheFuture);
pub unsafe fn GetIsForcedValid(&self, aIsForcedValid: *mut bool) -> nsresult
[src]
/**
* The 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 attribute boolean isForcedValid;
pub unsafe fn OpenInputStream(
&self,
offset: int64_t,
_retval: *mut *const nsIInputStream
) -> nsresult
[src]
&self,
offset: int64_t,
_retval: *mut *const nsIInputStream
) -> nsresult
/**
* 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.
*
* @param offset
* read starting from this offset into the cached data. an offset
* beyond the end of the stream has undefined consequences.
*
* @return non-blocking, buffered input stream.
*/
nsIInputStream openInputStream (in long long offset);
pub unsafe fn OpenOutputStream(
&self,
offset: int64_t,
_retval: *mut *const nsIOutputStream
) -> nsresult
[src]
&self,
offset: int64_t,
_retval: *mut *const nsIOutputStream
) -> nsresult
/**
* 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.
*
* @param offset
* write starting from this offset into the cached data. an offset
* beyond the end of the stream has undefined consequences.
*
* @return blocking, buffered output stream.
*/
nsIOutputStream openOutputStream (in long long offset);
pub unsafe fn GetPredictedDataSize(
&self,
aPredictedDataSize: *mut int64_t
) -> nsresult
[src]
&self,
aPredictedDataSize: *mut int64_t
) -> nsresult
/**
* Stores the Content-Length specified in the HTTP header for this
* entry. Checked before we write to the cache entry, to prevent ever
* taking up space in the cache for an entry that we know up front
* is going to have to be evicted anyway. See bug 588507.
*/
attribute int64_t predictedDataSize;
pub unsafe fn SetPredictedDataSize(
&self,
aPredictedDataSize: int64_t
) -> nsresult
[src]
&self,
aPredictedDataSize: int64_t
) -> nsresult
/**
* Stores the Content-Length specified in the HTTP header for this
* entry. Checked before we write to the cache entry, to prevent ever
* taking up space in the cache for an entry that we know up front
* is going to have to be evicted anyway. See bug 588507.
*/
attribute int64_t predictedDataSize;
pub unsafe fn GetSecurityInfo(
&self,
aSecurityInfo: *mut *const nsISupports
) -> nsresult
[src]
&self,
aSecurityInfo: *mut *const nsISupports
) -> nsresult
/**
* Get/set security info on the cache entry for this descriptor.
*/
attribute nsISupports securityInfo;
pub unsafe fn SetSecurityInfo(
&self,
aSecurityInfo: *const nsISupports
) -> nsresult
[src]
&self,
aSecurityInfo: *const nsISupports
) -> nsresult
/**
* Get/set security info on the cache entry for this descriptor.
*/
attribute nsISupports securityInfo;
pub unsafe fn GetStorageDataSize(
&self,
aStorageDataSize: *mut uint32_t
) -> nsresult
[src]
&self,
aStorageDataSize: *mut uint32_t
) -> nsresult
/**
* Get the size of the cache entry data, as stored. This may differ
* from the entry's dataSize, if the entry is compressed.
*/
readonly attribute unsigned long storageDataSize;
pub unsafe fn AsyncDoom(
&self,
listener: *const nsICacheEntryDoomCallback
) -> nsresult
[src]
&self,
listener: *const nsICacheEntryDoomCallback
) -> nsresult
/**
* Asynchronously doom an entry. Listener will be notified about the status
* of the operation. Null may be passed if caller doesn't care about the
* result.
*/
void asyncDoom (in nsICacheEntryDoomCallback listener);
pub unsafe fn GetMetaDataElement(
&self,
key: *const c_char,
_retval: *mut *const c_char
) -> nsresult
[src]
&self,
key: *const c_char,
_retval: *mut *const c_char
) -> nsresult
/**
* Methods for accessing meta data. Meta data is a table of key/value
* string pairs. The strings do not have to conform to any particular
* charset, but they must be null terminated.
*/
string getMetaDataElement (in string key);
pub unsafe fn SetMetaDataElement(
&self,
key: *const c_char,
value: *const c_char
) -> nsresult
[src]
&self,
key: *const c_char,
value: *const c_char
) -> nsresult
void setMetaDataElement (in string key, in string value);
pub unsafe fn VisitMetaData(
&self,
visitor: *const nsICacheEntryMetaDataVisitor
) -> nsresult
[src]
&self,
visitor: *const nsICacheEntryMetaDataVisitor
) -> nsresult
/**
* 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.
*/
void visitMetaData (in nsICacheEntryMetaDataVisitor visitor);
pub unsafe fn MetaDataReady(&self) -> nsresult
[src]
/**
* Claims that all metadata on this entry are up-to-date and this entry
* now can be delivered to other waiting consumers.
*
* We need such method since metadata must be delivered synchronously.
*/
void metaDataReady ();
pub unsafe fn SetValid(&self) -> nsresult
[src]
/**
* 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.
*/
void setValid ();
pub unsafe fn Dismiss(&self) -> nsresult
[src]
/**
* 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.
*/
void dismiss ();
pub unsafe fn GetDiskStorageSizeInKB(
&self,
aDiskStorageSizeInKB: *mut uint32_t
) -> nsresult
[src]
&self,
aDiskStorageSizeInKB: *mut uint32_t
) -> nsresult
/**
* Returns the size in kilobytes used to store the cache entry on disk.
*/
readonly attribute uint32_t diskStorageSizeInKB;
pub unsafe fn Recreate(
&self,
aMemoryOnly: bool,
_retval: *mut *const nsICacheEntry
) -> nsresult
[src]
&self,
aMemoryOnly: bool,
_retval: *mut *const nsICacheEntry
) -> nsresult
/**
* 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.
*
* @param aMemoryOnly
* - whether the entry is to be created as memory/only regardless how
* the entry being recreated persistence is set
* @returns
* - an entry that can be used to write to
* @throws
* - NS_ERROR_NOT_AVAILABLE when the entry cannot be from some reason
* recreated for write
*/
nsICacheEntry recreate ([optional] in boolean aMemoryOnly);
pub unsafe fn GetDataSize(&self, aDataSize: *mut int64_t) -> nsresult
[src]
/**
* Returns the length of data this entry holds.
* @throws
* NS_ERROR_IN_PROGRESS when the write is still in progress.
*/
readonly attribute long long dataSize;
pub unsafe fn GetAltDataSize(&self, aAltDataSize: *mut int64_t) -> nsresult
[src]
/**
* Returns the length of data this entry holds.
* @throws
* - NS_ERROR_IN_PROGRESS when a write is still in progress (either real
content or alt data).
* - NS_ERROR_NOT_AVAILABLE if alt data does not exist.
*/
readonly attribute long long altDataSize;
pub unsafe fn OpenAlternativeOutputStream(
&self,
type_: &nsACString,
_retval: *mut *const nsIOutputStream
) -> nsresult
[src]
&self,
type_: &nsACString,
_retval: *mut *const nsIOutputStream
) -> nsresult
/**
* Opens and returns an output stream that a consumer may use to save an
* alternate representation of the data.
* @throws
* - NS_ERROR_NOT_AVAILABLE if the real data hasn't been written.
* - NS_ERROR_IN_PROGRESS when the writing regular content or alt-data to
* the cache entry is still in progress.
*
* If there is alt-data already saved, it will be overwritten.
*/
nsIOutputStream openAlternativeOutputStream (in ACString type);
pub unsafe fn OpenAlternativeInputStream(
&self,
type_: &nsACString,
_retval: *mut *const nsIInputStream
) -> nsresult
[src]
&self,
type_: &nsACString,
_retval: *mut *const nsIInputStream
) -> nsresult
/**
* 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.
* @throws
* - NS_ERROR_NOT_AVAILABLE if the alt-data representation doesn't exist at
* all or if alt-data of the given type doesn't exist.
*/
nsIInputStream openAlternativeInputStream (in ACString type);
pub unsafe fn GetLoadContextInfo(
&self,
aLoadContextInfo: *mut *const nsILoadContextInfo
) -> nsresult
[src]
&self,
aLoadContextInfo: *mut *const nsILoadContextInfo
) -> nsresult
/**
* Get the nsILoadContextInfo of the cache entry
*/
readonly attribute nsILoadContextInfo loadContextInfo;
pub unsafe fn Close(&self) -> nsresult
[src]
/****************************************************************************
* 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.
*/
/**
* @deprecated
* 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()
*/
void close ();
pub unsafe fn MarkValid(&self) -> nsresult
[src]
/**
* @deprecated
* FOR BACKWARD COMPATIBILITY ONLY
* Marks the entry as valid so that others can use it and get only readonly
* access when the entry is held by the 1st writer.
*/
void markValid ();
pub unsafe fn MaybeMarkValid(&self) -> nsresult
[src]
/**
* @deprecated
* FOR BACKWARD COMPATIBILITY ONLY
* Marks the entry as valid when write access is acquired.
*/
void maybeMarkValid ();
pub unsafe fn HasWriteAccess(
&self,
aWriteAllowed: bool,
_retval: *mut bool
) -> nsresult
[src]
&self,
aWriteAllowed: bool,
_retval: *mut bool
) -> nsresult
/**
* @deprecated
* FOR BACKWARD COMPATIBILITY ONLY / KINDA HACK
* @param aWriteAllowed
* Consumer indicates whether write to the entry is allowed for it.
* Depends on implementation how the flag is handled.
* @returns
* true when write access is acquired for this entry,
* false otherwise
*/
boolean hasWriteAccess (in boolean aWriteAllowed);
Methods from Deref<Target = nsISupports>
pub fn coerce<T: nsISupportsCoerce>(&self) -> &T
[src]
Cast this nsISupports
to one of its base interfaces.
pub unsafe fn QueryInterface(
&self,
uuid: &nsIID,
result: *mut *mut c_void
) -> nsresult
[src]
&self,
uuid: &nsIID,
result: *mut *mut c_void
) -> nsresult
void QueryInterface (in nsIIDRef uuid, [iid_is (uuid), retval] out nsQIResult result);
pub unsafe fn AddRef(&self) -> nsrefcnt
[src]
[noscript,notxpcom] nsrefcnt AddRef ();
pub unsafe fn Release(&self) -> nsrefcnt
[src]
[noscript,notxpcom] nsrefcnt Release ();
Trait Implementations
impl XpCom for nsICacheEntry
[src]
const IID: nsIID
IID: nsIID = nsID(1618749996, 2632, 16569, [169, 86, 140, 242, 187, 152, 87, 207])
fn query_interface<T: XpCom>(&self) -> Option<RefPtr<T>>
[src]
Perform a QueryInterface call on this object, attempting to dynamically cast it to the requested interface type. Returns Some(RefPtr) if the cast succeeded, and None otherwise. Read more
impl RefCounted for nsICacheEntry
[src]
unsafe fn addref(&self)
[src]
Increment the reference count.
unsafe fn release(&self)
[src]
Decrement the reference count, potentially freeing backing memory.
impl Deref for nsICacheEntry
[src]
type Target = nsISupports
The resulting type after dereferencing.
fn deref(&self) -> &nsISupports
[src]
Dereferences the value.