Update To 11.40.268.0
[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=ServiceWorkerCache,
11     TypeChecking=Interface,
12 ] interface Cache {
13   // FIXME: Blink doesn't support union types, we use overrides instead. See http://crbug.com/240176
14
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);
18
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);
24
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);
29
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);
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, Response response);
39
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);
43
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);
47 };