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

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

Issue 434543002: Introducing the ServiceWorker Cache object. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: remediate and update to spec Created 6 years, 4 months 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
Index: Source/modules/serviceworkers/Cache.idl
diff --git a/Source/modules/serviceworkers/Cache.idl b/Source/modules/serviceworkers/Cache.idl
new file mode 100644
index 0000000000000000000000000000000000000000..890f696af2b88bf8e397952d3bac236d5a085f4f
--- /dev/null
+++ b/Source/modules/serviceworkers/Cache.idl
@@ -0,0 +1,51 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// FIXME: Blink doesn't support dictionary definitions. For now, we can use the
+// Dictionary interface. See http://crbug.com/321462
+
+// dictionary QueryParams {
+// boolean ignoreSearch;
+// boolean ignoreMethod;
+// boolean ignoreVary;
+// boolean prefixMatch;
+// DOMString cacheName;
+// };
+
+[
+ WillBeGarbageCollected,
+ NoInterfaceObject,
+ Exposed=ServiceWorker,
+ RuntimeEnabled=ServiceWorker,
+] interface Cache {
+ // FIXME: Blink doesn't support union types, we use overrides instead. See http://crbug.com/240176
+
+ // [CallWith=ScriptState] Promise match((Request or ScalarValueString) request, optional Dictionary queryParams);
+ [CallWith=ScriptState] Promise match(Request request, optional Dictionary queryParams);
+ [CallWith=ScriptState] Promise match(ScalarValueString request, optional Dictionary queryParams);
+
+ // [CallWith=ScriptState] Promise matchAll((Request or ScalarValueString) request, optional Dictionary queryParams);
+ [CallWith=ScriptState] Promise matchAll(Request request, optional Dictionary queryParams);
+ [CallWith=ScriptState] Promise matchAll(ScalarValueString request, optional Dictionary queryParams);
+
+ // [CallWith=ScriptState] Promise add((Request or ScalarValueString) request);
+ [CallWith=ScriptState] Promise add(Request request);
+
+ // 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 ScalarValueString> requests);
+ [CallWith=ScriptState] Promise addAll(sequence<any> requests);
+
+ // [CallWith=ScriptState] Promise put((Request or ScalarValueString) request, Response response);
+ [CallWith=ScriptState] Promise put(Request request, Response response);
+ [CallWith=ScriptState] Promise put(ScalarValueString request, Response response);
+
+ // [CallWith=ScriptState] Promise delete((Request or ScalarValueString) request, optional Dictionary queryParams);
+ [CallWith=ScriptState, ImplementedAs=deleteFunction] Promise delete(Request request, optional Dictionary queryParams);
+ [CallWith=ScriptState, ImplementedAs=deleteFunction] Promise delete(ScalarValueString request, optional Dictionary queryParams);
+
+ // [CallWith=ScriptState] Promise keys(optional (Request or ScalarValueString) request, optional Dictionary queryParams);
+ [CallWith=ScriptState] Promise keys(optional Request request, optional Dictionary queryParams);
+ [CallWith=ScriptState] Promise keys(ScalarValueString request, optional Dictionary queryParams);
+};

Powered by Google App Engine
This is Rietveld 408576698