1/* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
4
5[Pref="browser.cache.offline.enable", Func="nsGlobalWindowInner::OfflineCacheAllowedForContext"]
6interface OfflineResourceList : EventTarget {
7  /**
8   * State of the application cache this object is associated with.
9   */
10
11  /* This object is not associated with an application cache. */
12  const unsigned short UNCACHED = 0;
13
14  /* The application cache is not being updated. */
15  const unsigned short IDLE = 1;
16
17  /* The manifest is being fetched and checked for updates */
18  const unsigned short CHECKING = 2;
19
20  /* Resources are being downloaded to be added to the cache */
21  const unsigned short DOWNLOADING = 3;
22
23  /* There is a new version of the application cache available */
24  const unsigned short UPDATEREADY = 4;
25
26  /* The application cache group is now obsolete. */
27  const unsigned short OBSOLETE = 5;
28
29  [Throws, UseCounter]
30  readonly attribute unsigned short status;
31
32  /**
33   * Begin the application update process on the associated application cache.
34   */
35  [Throws, UseCounter]
36  void update();
37
38  /**
39   * Swap in the newest version of the application cache, or disassociate
40   * from the cache if the cache group is obsolete.
41   */
42  [Throws, UseCounter]
43  void swapCache();
44
45  /* Events */
46  [UseCounter]
47  attribute EventHandler onchecking;
48  [UseCounter]
49  attribute EventHandler onerror;
50  [UseCounter]
51  attribute EventHandler onnoupdate;
52  [UseCounter]
53  attribute EventHandler ondownloading;
54  [UseCounter]
55  attribute EventHandler onprogress;
56  [UseCounter]
57  attribute EventHandler onupdateready;
58  [UseCounter]
59  attribute EventHandler oncached;
60  [UseCounter]
61  attribute EventHandler onobsolete;
62};
63