OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <html> |
| 3 <title>Service Workers: CacheStorage</title> |
| 4 <head> |
| 5 <link rel="help" href="https://w3c.github.io/ServiceWorker/#cache-storag
e"> |
| 6 <script src="/resources/testharness.js"></script> |
| 7 <script src="/resources/testharnessreport.js"></script> |
| 8 |
| 9 <script src=/resources/WebIDLParser.js></script> |
| 10 <script src=/resources/idlharness.js></script> |
| 11 |
| 12 </head> |
| 13 <body> |
| 14 |
| 15 <script type=text/plain id="idl_0"> |
| 16 [Constructor(sequence<any> iterable)] |
| 17 interface CacheStorage { |
| 18 Promise<any> match(ScalarValueString url, optional DOMString cacheName); |
| 19 Promise<Cache> get(DOMString key); |
| 20 Promise<boolean> has(DOMString key); |
| 21 Promise<any> set(DOMString key, Cache val); |
| 22 Promise<any> clear(); |
| 23 Promise<any> delete(DOMString key); |
| 24 void forEach(CacheStorageIterationCallback callback, optional object thisArg); |
| 25 Promise<sequence<any>> entries(); |
| 26 Promise<sequence<DOMString>> keys(); |
| 27 Promise<sequence<Cache>> values(); |
| 28 Promise<unsigned long> size(); |
| 29 }; |
| 30 |
| 31 callback CacheStorageIterationCallback = void (Cache value, DOMString key, Cache
Storage map); |
| 32 </pre> |
| 33 |
| 34 <!-- |
| 35 **Note**:[CacheStorage][1]interface is designed to largely conform |
| 36 to[ECMAScript 6 Map objects][2]but entirely async, and with additional |
| 37 convenience methods. |
| 38 |
| 39 [1]: #cache-storage-interface |
| 40 [2]: http://goo.gl/gNnDPO |
| 41 --> |
| 42 |
| 43 |
| 44 <script type=text/plain id="untested_idls"> |
| 45 interface ScalarValueString {}; |
| 46 interface Cache {}; |
| 47 </pre> |
| 48 |
| 49 <script> |
| 50 var idl_array = new IdlArray(); |
| 51 idl_array.add_untested_idls(document.getElementById("untested_idls").tex
tContent); |
| 52 idl_array.add_idls(document.getElementById("idl_0").textContent); |
| 53 idl_array.add_objects({ |
| 54 CacheStorage: ["throw new Error ('No object defined for the CacheSto
rage interface')"], |
| 55 CacheStorageIterationCallback: ["throw new Error ('No object defined
for the CacheStorageIterationCallback callback')"] |
| 56 }); |
| 57 idl_array.test(); |
| 58 </script> |
| 59 |
| 60 </body> |
| 61 </html> |
| 62 |
OLD | NEW |