|
1 /* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- |
|
2 * |
|
3 * This Source Code Form is subject to the terms of the Mozilla Public |
|
4 * License, v. 2.0. If a copy of the MPL was not distributed with this |
|
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
|
6 |
|
7 #include "nsIApplicationCacheContainer.idl" |
|
8 |
|
9 /** |
|
10 * Interface implemented by channels that support application caches. |
|
11 */ |
|
12 [scriptable, uuid(6FA816B1-6D5F-4380-9704-054D0908CFA3)] |
|
13 interface nsIApplicationCacheChannel : nsIApplicationCacheContainer |
|
14 { |
|
15 /** |
|
16 * TRUE when the resource came from the application cache. This |
|
17 * might be false even there is assigned an application cache |
|
18 * e.g. in case of fallback of load of an entry matching bypass |
|
19 * namespace. |
|
20 */ |
|
21 readonly attribute boolean loadedFromApplicationCache; |
|
22 |
|
23 /** |
|
24 * When true, the channel will ask its notification callbacks for |
|
25 * an application cache if one is not explicitly provided. Default |
|
26 * value is true. |
|
27 * |
|
28 * NS_ERROR_ALREADY_OPENED will be thrown if set after AsyncOpen() |
|
29 * is called. |
|
30 */ |
|
31 attribute boolean inheritApplicationCache; |
|
32 |
|
33 /** |
|
34 * When true, the channel will choose an application cache if one |
|
35 * was not explicitly provided and none is available from the |
|
36 * notification callbacks. Default value is false. |
|
37 * |
|
38 * This attribute will not be transferred through a redirect. |
|
39 * |
|
40 * NS_ERROR_ALREADY_OPENED will be thrown if set after AsyncOpen() |
|
41 * is called. |
|
42 */ |
|
43 attribute boolean chooseApplicationCache; |
|
44 |
|
45 /** |
|
46 * A shortcut method to mark the cache item of this channel as 'foreign'. |
|
47 * See the 'cache selection algorithm' and CACHE_SELECTION_RELOAD |
|
48 * action handling in nsContentSink. |
|
49 */ |
|
50 void markOfflineCacheEntryAsForeign(); |
|
51 |
|
52 /** |
|
53 * Set offline application cache object to instruct the channel |
|
54 * to cache for offline use using this application cache. |
|
55 */ |
|
56 attribute nsIApplicationCache applicationCacheForWrite; |
|
57 }; |