michael@0: /* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- michael@0: * michael@0: * This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #include "nsIApplicationCacheContainer.idl" michael@0: michael@0: /** michael@0: * Interface implemented by channels that support application caches. michael@0: */ michael@0: [scriptable, uuid(6FA816B1-6D5F-4380-9704-054D0908CFA3)] michael@0: interface nsIApplicationCacheChannel : nsIApplicationCacheContainer michael@0: { michael@0: /** michael@0: * TRUE when the resource came from the application cache. This michael@0: * might be false even there is assigned an application cache michael@0: * e.g. in case of fallback of load of an entry matching bypass michael@0: * namespace. michael@0: */ michael@0: readonly attribute boolean loadedFromApplicationCache; michael@0: michael@0: /** michael@0: * When true, the channel will ask its notification callbacks for michael@0: * an application cache if one is not explicitly provided. Default michael@0: * value is true. michael@0: * michael@0: * NS_ERROR_ALREADY_OPENED will be thrown if set after AsyncOpen() michael@0: * is called. michael@0: */ michael@0: attribute boolean inheritApplicationCache; michael@0: michael@0: /** michael@0: * When true, the channel will choose an application cache if one michael@0: * was not explicitly provided and none is available from the michael@0: * notification callbacks. Default value is false. michael@0: * michael@0: * This attribute will not be transferred through a redirect. michael@0: * michael@0: * NS_ERROR_ALREADY_OPENED will be thrown if set after AsyncOpen() michael@0: * is called. michael@0: */ michael@0: attribute boolean chooseApplicationCache; michael@0: michael@0: /** michael@0: * A shortcut method to mark the cache item of this channel as 'foreign'. michael@0: * See the 'cache selection algorithm' and CACHE_SELECTION_RELOAD michael@0: * action handling in nsContentSink. michael@0: */ michael@0: void markOfflineCacheEntryAsForeign(); michael@0: michael@0: /** michael@0: * Set offline application cache object to instruct the channel michael@0: * to cache for offline use using this application cache. michael@0: */ michael@0: attribute nsIApplicationCache applicationCacheForWrite; michael@0: };