OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // See https://slightlyoff.github.io/ServiceWorker/spec/service_worker/index.htm
l#cache | 5 // See https://slightlyoff.github.io/ServiceWorker/spec/service_worker/index.htm
l#cache |
6 | 6 |
| 7 typedef (Request or USVString) RequestInfo; |
| 8 |
7 [ | 9 [ |
8 GarbageCollected, | 10 GarbageCollected, |
9 Exposed=ServiceWorker, | 11 Exposed=ServiceWorker, |
10 RuntimeEnabled=ServiceWorkerCache, | 12 RuntimeEnabled=ServiceWorkerCache, |
11 TypeChecking=Interface, | 13 TypeChecking=Interface, |
12 ] interface Cache { | 14 ] interface Cache { |
13 // FIXME: Blink doesn't support union types, we use overrides instead. See htt
p://crbug.com/240176 | 15 [CallWith=ScriptState, RaisesException] Promise match(RequestInfo request, o
ptional CacheQueryOptions options); |
14 | 16 |
15 // [CallWith=ScriptState] Promise match((Request or USVString) request, option
al CacheQueryOptions options); | 17 // FIXME: Implement matchAll(): http://crbug.com/428363 |
16 [CallWith=ScriptState] Promise match(Request request, optional CacheQueryOptio
ns options); | 18 // FIXME: First argument of matchAll() should be optional: http://crbug.com/
425459 |
17 [CallWith=ScriptState, RaisesException] Promise match(USVString request, optio
nal CacheQueryOptions options); | 19 // [CallWith=ScriptState, RaisesException] Promise matchAll(RequestInfo requ
est, optional CacheQueryOptions options); |
18 | 20 |
19 // FIXME: Implement matchAll(): http://crbug.com/428363 | 21 // FIXME: Implement add(): http://crbug.com/427652 |
20 // FIXME: First argument of matchAll() should be optional: http://crbug.com/42
5459 | 22 // [CallWith=ScriptState, RaisesException] Promise add(RequestInfo request); |
21 // [CallWith=ScriptState] Promise matchAll((Request or USVString) request, opt
ional CacheQueryOptions options); | |
22 // [CallWith=ScriptState] Promise matchAll(Request request, optional CacheQuer
yOptions options); | |
23 // [CallWith=ScriptState, RaisesException] Promise matchAll(USVString request,
optional CacheQueryOptions options); | |
24 | 23 |
25 // FIXME: Implement add(): http://crbug.com/427652 | 24 // FIXME: Implement addAll(): http://crbug.com/427652 |
26 // [CallWith=ScriptState] Promise add((Request or USVString) request); | 25 // FIXME: Sequences of Unions are not yet supported, instead bind a generic
type. http://crbug.com/240176 |
27 // [CallWith=ScriptState] Promise add(Request request); | 26 // [CallWith=ScriptState] Promise addAll(sequence<RequestInfo> requests); |
28 // [CallWith=ScriptState, RaisesException] Promise add(USVString request); | 27 // [CallWith=ScriptState] Promise addAll(sequence<any> requests); |
29 | 28 |
30 // FIXME: Implement addAll(): http://crbug.com/427652 | 29 [CallWith=ScriptState, RaisesException] Promise put(RequestInfo request, Res
ponse response); |
31 // FIXME: The lack of union type support together with the sequence mean we ca
n't use overrides here, instead | 30 [CallWith=ScriptState, ImplementedAs=deleteFunction, RaisesException] Promis
e delete(RequestInfo request, optional CacheQueryOptions options); |
32 // bind a generic type. | 31 [CallWith=ScriptState, RaisesException] Promise keys(optional RequestInfo re
quest, optional CacheQueryOptions options); |
33 // [CallWith=ScriptState] Promise addAll(sequence<Request or USVString> reques
ts); | |
34 // [CallWith=ScriptState] Promise addAll(sequence<any> requests); | |
35 | |
36 // [CallWith=ScriptState] Promise put((Request or USVString) request, Response
response); | |
37 [CallWith=ScriptState] Promise put(Request request, Response response); | |
38 [CallWith=ScriptState, RaisesException] Promise put(USVString request, Respons
e response); | |
39 | |
40 // [CallWith=ScriptState] Promise delete((Request or USVString) request, optio
nal CacheQueryOptions options); | |
41 [CallWith=ScriptState, ImplementedAs=deleteFunction] Promise delete(Request re
quest, optional CacheQueryOptions options); | |
42 [CallWith=ScriptState, ImplementedAs=deleteFunction, RaisesException] Promise
delete(USVString request, optional CacheQueryOptions options); | |
43 | |
44 // [CallWith=ScriptState] Promise keys(optional (Request or USVString) request
, optional CacheQueryOptions options); | |
45 [CallWith=ScriptState] Promise keys(optional Request request, optional CacheQu
eryOptions options); | |
46 [CallWith=ScriptState, RaisesException] Promise keys(USVString request, option
al CacheQueryOptions options); | |
47 }; | 32 }; |
OLD | NEW |