netwerk/base/nsICacheInfoChannel.idl
author Atul Kumar <atkr.oss@gmail.com>
Wed, 10 Jun 2015 09:46:16 -0700
changeset 248115 fcfdee109765d38d65a680307975620173f5007c
parent 243906 50c7134b44088ae055e039d318128496cca314f5
child 280682 865eddafd4e9345634b67c39b4e3b9992c46fc0f
permissions -rw-r--r--
Bug 1136301 - Null check for mCert->slot added in destructorSafeDestroyNSSReference & MarkForPermDeletion. Formatting update in MarkForPermDeletion. r=keeler

/* 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/. */

#include "nsISupports.idl"

[scriptable, uuid (c5f583f0-ae53-4e39-8af9-2c2d0d7af093)]
interface nsICacheInfoChannel : nsISupports
{
  /**
   * Get expiration time from cache token. This attribute is equivalent to
   * nsICachingChannel.cacheToken.expirationTime.
   */
  readonly attribute uint32_t cacheTokenExpirationTime;

  /**
   * 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();

  /**
   * 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.
   *
   * A cache key retrieved from a particular instance of nsICacheInfoChannel
   * could be set on another instance of nsICacheInfoChannel provided the
   * underlying implementations are compatible and provided the new 
   * channel instance was created with the same URI.  The implementation of
   * nsICacheInfoChannel would be expected to use the cache entry identified
   * 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;
};