2012-05-21 15:12:37 +04:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2010-06-24 10:55:19 +04:00
|
|
|
|
|
|
|
#include "nsISupports.idl"
|
|
|
|
|
2016-01-19 17:28:00 +03:00
|
|
|
[scriptable, uuid(72c34415-c6eb-48af-851f-772fa9ee5972)]
|
2010-06-24 10:55:19 +04:00
|
|
|
interface nsICacheInfoChannel : nsISupports
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Get expiration time from cache token. This attribute is equivalent to
|
|
|
|
* nsICachingChannel.cacheToken.expirationTime.
|
|
|
|
*/
|
2012-08-22 19:56:38 +04:00
|
|
|
readonly attribute uint32_t cacheTokenExpirationTime;
|
2010-06-24 10:55:19 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Set/get charset of cache entry. Accessing this attribute is equivalent to
|
|
|
|
* calling nsICachingChannel.cacheToken.getMetaDataElement("charset") and
|
|
|
|
* nsICachingChannel.cacheToken.setMetaDataElement("charset").
|
|
|
|
*/
|
|
|
|
attribute ACString cacheTokenCachedCharset;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* TRUE if this channel's data is being loaded from the cache. This value
|
|
|
|
* is undefined before the channel fires its OnStartRequest notification
|
|
|
|
* and after the channel fires its OnStopRequest notification.
|
|
|
|
*/
|
|
|
|
boolean isFromCache();
|
2015-05-10 03:26:39 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Set/get the cache key... uniquely identifies the data in the cache
|
|
|
|
* for this channel. Holding a reference to this key does NOT prevent
|
|
|
|
* the cached data from being removed.
|
|
|
|
*
|
2015-05-14 20:05:34 +03:00
|
|
|
* A cache key retrieved from a particular instance of nsICacheInfoChannel
|
|
|
|
* could be set on another instance of nsICacheInfoChannel provided the
|
2015-05-10 03:26:39 +03:00
|
|
|
* underlying implementations are compatible and provided the new
|
|
|
|
* channel instance was created with the same URI. The implementation of
|
2015-05-14 20:05:34 +03:00
|
|
|
* nsICacheInfoChannel would be expected to use the cache entry identified
|
2015-05-10 03:26:39 +03:00
|
|
|
* by the cache token. Depending on the value of nsIRequest::loadFlags,
|
|
|
|
* the cache entry may be validated, overwritten, or simply read.
|
|
|
|
*
|
|
|
|
* The cache key may be NULL indicating that the URI of the channel is
|
|
|
|
* sufficient to locate the same cache entry. Setting a NULL cache key
|
|
|
|
* is likewise valid.
|
|
|
|
*/
|
|
|
|
attribute nsISupports cacheKey;
|
2016-01-19 17:28:00 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Tells the channel to behave as if the LOAD_FROM_CACHE flag has been set,
|
|
|
|
* but without affecting the loads for the entire loadGroup in case of this
|
|
|
|
* channel being the default load group's channel.
|
|
|
|
*/
|
|
|
|
attribute boolean allowStaleCacheContent;
|
2010-06-24 10:55:19 +04:00
|
|
|
};
|