Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2186)

Unified Diff: Source/modules/serviceworkers/Cache.idl

Issue 700323003: Use Web IDL Union types in Service Worker's Cache interface (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebased Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/modules/serviceworkers/Cache.cpp ('k') | Source/modules/serviceworkers/CacheTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/serviceworkers/Cache.idl
diff --git a/Source/modules/serviceworkers/Cache.idl b/Source/modules/serviceworkers/Cache.idl
index 739d2665ad9e0c256008aecec0e2646942ae63cf..9ffbf8e1b25ae1cc1183231799c38ceb83273a9c 100644
--- a/Source/modules/serviceworkers/Cache.idl
+++ b/Source/modules/serviceworkers/Cache.idl
@@ -4,44 +4,29 @@
// See https://slightlyoff.github.io/ServiceWorker/spec/service_worker/index.html#cache
+typedef (Request or USVString) RequestInfo;
+
[
GarbageCollected,
Exposed=ServiceWorker,
RuntimeEnabled=ServiceWorkerCache,
TypeChecking=Interface,
] interface Cache {
- // FIXME: Blink doesn't support union types, we use overrides instead. See http://crbug.com/240176
-
- // [CallWith=ScriptState] Promise match((Request or USVString) request, optional CacheQueryOptions options);
- [CallWith=ScriptState] Promise match(Request request, optional CacheQueryOptions options);
- [CallWith=ScriptState, RaisesException] Promise match(USVString request, optional CacheQueryOptions options);
-
- // FIXME: Implement matchAll(): http://crbug.com/428363
- // FIXME: First argument of matchAll() should be optional: http://crbug.com/425459
- // [CallWith=ScriptState] Promise matchAll((Request or USVString) request, optional CacheQueryOptions options);
- // [CallWith=ScriptState] Promise matchAll(Request request, optional CacheQueryOptions options);
- // [CallWith=ScriptState, RaisesException] Promise matchAll(USVString request, optional CacheQueryOptions options);
-
- // FIXME: Implement add(): http://crbug.com/427652
- // [CallWith=ScriptState] Promise add((Request or USVString) request);
- // [CallWith=ScriptState] Promise add(Request request);
- // [CallWith=ScriptState, RaisesException] Promise add(USVString request);
+ [CallWith=ScriptState, RaisesException] Promise match(RequestInfo request, optional CacheQueryOptions options);
- // FIXME: Implement addAll(): http://crbug.com/427652
- // FIXME: The lack of union type support together with the sequence mean we can't use overrides here, instead
- // bind a generic type.
- // [CallWith=ScriptState] Promise addAll(sequence<Request or USVString> requests);
- // [CallWith=ScriptState] Promise addAll(sequence<any> requests);
+ // FIXME: Implement matchAll(): http://crbug.com/428363
+ // FIXME: First argument of matchAll() should be optional: http://crbug.com/425459
+ // [CallWith=ScriptState, RaisesException] Promise matchAll(RequestInfo request, optional CacheQueryOptions options);
- // [CallWith=ScriptState] Promise put((Request or USVString) request, Response response);
- [CallWith=ScriptState] Promise put(Request request, Response response);
- [CallWith=ScriptState, RaisesException] Promise put(USVString request, Response response);
+ // FIXME: Implement add(): http://crbug.com/427652
+ // [CallWith=ScriptState, RaisesException] Promise add(RequestInfo request);
- // [CallWith=ScriptState] Promise delete((Request or USVString) request, optional CacheQueryOptions options);
- [CallWith=ScriptState, ImplementedAs=deleteFunction] Promise delete(Request request, optional CacheQueryOptions options);
- [CallWith=ScriptState, ImplementedAs=deleteFunction, RaisesException] Promise delete(USVString request, optional CacheQueryOptions options);
+ // FIXME: Implement addAll(): http://crbug.com/427652
+ // FIXME: Sequences of Unions are not yet supported, instead bind a generic type. http://crbug.com/240176
+ // [CallWith=ScriptState] Promise addAll(sequence<RequestInfo> requests);
+ // [CallWith=ScriptState] Promise addAll(sequence<any> requests);
- // [CallWith=ScriptState] Promise keys(optional (Request or USVString) request, optional CacheQueryOptions options);
- [CallWith=ScriptState] Promise keys(optional Request request, optional CacheQueryOptions options);
- [CallWith=ScriptState, RaisesException] Promise keys(USVString request, optional CacheQueryOptions options);
+ [CallWith=ScriptState, RaisesException] Promise put(RequestInfo request, Response response);
+ [CallWith=ScriptState, ImplementedAs=deleteFunction, RaisesException] Promise delete(RequestInfo request, optional CacheQueryOptions options);
+ [CallWith=ScriptState, RaisesException] Promise keys(optional RequestInfo request, optional CacheQueryOptions options);
};
« no previous file with comments | « Source/modules/serviceworkers/Cache.cpp ('k') | Source/modules/serviceworkers/CacheTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698