6da74e950821054742d76b225f95ca879f97b3fe
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / Source / modules / serviceworkers / Cache.idl
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.
4
5 // See https://slightlyoff.github.io/ServiceWorker/spec/service_worker/index.html#cache
6
7 [
8     GarbageCollected,
9     Exposed=ServiceWorker,
10     RuntimeEnabled=ServiceWorkerOnFetch,
11 ] interface Cache {
12   // FIXME: Blink doesn't support union types, we use overrides instead. See http://crbug.com/240176
13
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);
17
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);
21
22   // [CallWith=ScriptState] Promise add((Request or ScalarValueString) request);
23   [CallWith=ScriptState] Promise add(Request request);
24   [CallWith=ScriptState] Promise add(ScalarValueString request);
25
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);
30
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);
34
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);
38
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);
42 };