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=ServiceWorkerOnFetch,
12 // FIXME: Blink doesn't support union types, we use overrides instead. See http://crbug.com/240176
14 // [CallWith=ScriptState] Promise match((Request or ScalarValueString) request, optional QueryParams queryParams);
15 [CallWith=ScriptState] Promise match(Request request, optional QueryParams queryParams);
16 [CallWith=ScriptState] Promise match(ScalarValueString request, optional QueryParams queryParams);
18 // [CallWith=ScriptState] Promise matchAll((Request or ScalarValueString) request, optional QueryParams queryParams);
19 [CallWith=ScriptState] Promise matchAll(Request request, optional QueryParams queryParams);
20 [CallWith=ScriptState] Promise matchAll(ScalarValueString request, optional QueryParams queryParams);
22 // [CallWith=ScriptState] Promise add((Request or ScalarValueString) request);
23 [CallWith=ScriptState] Promise add(Request request);
24 [CallWith=ScriptState] Promise add(ScalarValueString request);
26 // FIXME: The lack of union type support together with the sequence mean we can't use overrides here, instead
27 // bind a generic type.
28 // [CallWith=ScriptState] Promise addAll(sequence<Request or ScalarValueString> requests);
29 [CallWith=ScriptState] Promise addAll(sequence<any> requests);
31 // [CallWith=ScriptState] Promise put((Request or ScalarValueString) request, Response response);
32 [CallWith=ScriptState] Promise put(Request request, Response response);
33 [CallWith=ScriptState] Promise put(ScalarValueString request, Response response);
35 // [CallWith=ScriptState] Promise delete((Request or ScalarValueString) request, optional QueryParams queryParams);
36 [CallWith=ScriptState, ImplementedAs=deleteFunction] Promise delete(Request request, optional QueryParams queryParams);
37 [CallWith=ScriptState, ImplementedAs=deleteFunction] Promise delete(ScalarValueString request, optional QueryParams queryParams);
39 // [CallWith=ScriptState] Promise keys(optional (Request or ScalarValueString) request, optional QueryParams queryParams);
40 [CallWith=ScriptState] Promise keys(optional Request request, optional QueryParams queryParams);
41 [CallWith=ScriptState] Promise keys(ScalarValueString request, optional QueryParams queryParams);