Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 2 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 3 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 4 | |
michael@0 | 5 | interface OfflineResourceList : EventTarget { |
michael@0 | 6 | /** |
michael@0 | 7 | * State of the application cache this object is associated with. |
michael@0 | 8 | */ |
michael@0 | 9 | |
michael@0 | 10 | /* This object is not associated with an application cache. */ |
michael@0 | 11 | const unsigned short UNCACHED = 0; |
michael@0 | 12 | |
michael@0 | 13 | /* The application cache is not being updated. */ |
michael@0 | 14 | const unsigned short IDLE = 1; |
michael@0 | 15 | |
michael@0 | 16 | /* The manifest is being fetched and checked for updates */ |
michael@0 | 17 | const unsigned short CHECKING = 2; |
michael@0 | 18 | |
michael@0 | 19 | /* Resources are being downloaded to be added to the cache */ |
michael@0 | 20 | const unsigned short DOWNLOADING = 3; |
michael@0 | 21 | |
michael@0 | 22 | /* There is a new version of the application cache available */ |
michael@0 | 23 | const unsigned short UPDATEREADY = 4; |
michael@0 | 24 | |
michael@0 | 25 | /* The application cache group is now obsolete. */ |
michael@0 | 26 | const unsigned short OBSOLETE = 5; |
michael@0 | 27 | |
michael@0 | 28 | [Throws] |
michael@0 | 29 | readonly attribute unsigned short status; |
michael@0 | 30 | |
michael@0 | 31 | /** |
michael@0 | 32 | * Begin the application update process on the associated application cache. |
michael@0 | 33 | */ |
michael@0 | 34 | [Throws] |
michael@0 | 35 | void update(); |
michael@0 | 36 | |
michael@0 | 37 | /** |
michael@0 | 38 | * Swap in the newest version of the application cache, or disassociate |
michael@0 | 39 | * from the cache if the cache group is obsolete. |
michael@0 | 40 | */ |
michael@0 | 41 | [Throws] |
michael@0 | 42 | void swapCache(); |
michael@0 | 43 | |
michael@0 | 44 | /* Events */ |
michael@0 | 45 | attribute EventHandler onchecking; |
michael@0 | 46 | attribute EventHandler onerror; |
michael@0 | 47 | attribute EventHandler onnoupdate; |
michael@0 | 48 | attribute EventHandler ondownloading; |
michael@0 | 49 | attribute EventHandler onprogress; |
michael@0 | 50 | attribute EventHandler onupdateready; |
michael@0 | 51 | attribute EventHandler oncached; |
michael@0 | 52 | attribute EventHandler onobsolete; |
michael@0 | 53 | }; |
michael@0 | 54 | |
michael@0 | 55 | // Mozilla extensions. |
michael@0 | 56 | partial interface OfflineResourceList { |
michael@0 | 57 | /** |
michael@0 | 58 | * Get the list of dynamically-managed entries. |
michael@0 | 59 | */ |
michael@0 | 60 | [Throws] |
michael@0 | 61 | readonly attribute DOMStringList mozItems; |
michael@0 | 62 | |
michael@0 | 63 | /** |
michael@0 | 64 | * Check that an entry exists in the list of dynamically-managed entries. |
michael@0 | 65 | * |
michael@0 | 66 | * @param uri |
michael@0 | 67 | * The resource to check. |
michael@0 | 68 | */ |
michael@0 | 69 | [Throws] |
michael@0 | 70 | boolean mozHasItem(DOMString uri); |
michael@0 | 71 | |
michael@0 | 72 | /** |
michael@0 | 73 | * Get the number of dynamically-managed entries. |
michael@0 | 74 | * @status DEPRECATED |
michael@0 | 75 | * Clients should use the "items" attribute. |
michael@0 | 76 | */ |
michael@0 | 77 | [Throws] |
michael@0 | 78 | readonly attribute unsigned long mozLength; |
michael@0 | 79 | |
michael@0 | 80 | /** |
michael@0 | 81 | * Get the URI of a dynamically-managed entry. |
michael@0 | 82 | * @status DEPRECATED |
michael@0 | 83 | * Clients should use the "items" attribute. |
michael@0 | 84 | */ |
michael@0 | 85 | [Throws] |
michael@0 | 86 | getter DOMString mozItem(unsigned long index); |
michael@0 | 87 | |
michael@0 | 88 | /** |
michael@0 | 89 | * Add an item to the list of dynamically-managed entries. The resource |
michael@0 | 90 | * will be fetched into the application cache. |
michael@0 | 91 | * |
michael@0 | 92 | * @param uri |
michael@0 | 93 | * The resource to add. |
michael@0 | 94 | */ |
michael@0 | 95 | [Throws] |
michael@0 | 96 | void mozAdd(DOMString uri); |
michael@0 | 97 | |
michael@0 | 98 | /** |
michael@0 | 99 | * Remove an item from the list of dynamically-managed entries. If this |
michael@0 | 100 | * was the last reference to a URI in the application cache, the cache |
michael@0 | 101 | * entry will be removed. |
michael@0 | 102 | * |
michael@0 | 103 | * @param uri |
michael@0 | 104 | * The resource to remove. |
michael@0 | 105 | */ |
michael@0 | 106 | [Throws] |
michael@0 | 107 | void mozRemove(DOMString uri); |
michael@0 | 108 | }; |