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
3 // found in the LICENSE file.
5 // See https://slightlyoff.github.io/ServiceWorker/spec/service_worker/index.html#cache
10 RuntimeEnabled=ServiceWorkerCache,
11 TypeChecking=Interface,
13 // FIXME: Blink doesn't support union types, we use overrides instead. See http://crbug.com/240176
15 // [CallWith=ScriptState] Promise match((Request or USVString) request, optional CacheQueryOptions options);
16 [CallWith=ScriptState] Promise match(Request request, optional CacheQueryOptions options);
17 [CallWith=ScriptState, RaisesException] Promise match(USVString request, optional CacheQueryOptions options);
19 // FIXME: Implement matchAll(): http://crbug.com/428363
20 // FIXME: First argument of matchAll() should be optional: http://crbug.com/425459
21 // [CallWith=ScriptState] Promise matchAll((Request or USVString) request, optional CacheQueryOptions options);
22 // [CallWith=ScriptState] Promise matchAll(Request request, optional CacheQueryOptions options);
23 // [CallWith=ScriptState, RaisesException] Promise matchAll(USVString request, optional CacheQueryOptions options);
25 // FIXME: Implement add(): http://crbug.com/427652
26 // [CallWith=ScriptState] Promise add((Request or USVString) request);
27 // [CallWith=ScriptState] Promise add(Request request);
28 // [CallWith=ScriptState, RaisesException] Promise add(USVString request);
30 // FIXME: Implement addAll(): http://crbug.com/427652
31 // FIXME: The lack of union type support together with the sequence mean we can't use overrides here, instead
32 // bind a generic type.
33 // [CallWith=ScriptState] Promise addAll(sequence<Request or USVString> requests);
34 // [CallWith=ScriptState] Promise addAll(sequence<any> requests);
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, Response response);
40 // [CallWith=ScriptState] Promise delete((Request or USVString) request, optional CacheQueryOptions options);
41 [CallWith=ScriptState, ImplementedAs=deleteFunction] Promise delete(Request request, optional CacheQueryOptions options);
42 [CallWith=ScriptState, ImplementedAs=deleteFunction, RaisesException] Promise delete(USVString request, optional CacheQueryOptions options);
44 // [CallWith=ScriptState] Promise keys(optional (Request or USVString) request, optional CacheQueryOptions options);
45 [CallWith=ScriptState] Promise keys(optional Request request, optional CacheQueryOptions options);
46 [CallWith=ScriptState, RaisesException] Promise keys(USVString request, optional CacheQueryOptions options);