Index: Source/modules/serviceworkers/Cache.h |
diff --git a/Source/modules/serviceworkers/Cache.h b/Source/modules/serviceworkers/Cache.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..f7f22290252dcc9a3437d684044ce47e1d1abfb1 |
--- /dev/null |
+++ b/Source/modules/serviceworkers/Cache.h |
@@ -0,0 +1,59 @@ |
+// 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. |
+ |
+#ifndef Cache_h |
+#define Cache_h |
+ |
+#include "bindings/core/v8/ScriptPromise.h" |
+#include "bindings/core/v8/ScriptState.h" |
falken
2014/08/06 04:46:28
Since ScriptState is forward declared below, don't
gavinp
2014/08/08 19:55:26
Done.
|
+#include "bindings/core/v8/ScriptWrappable.h" |
+#include "wtf/Forward.h" |
+#include "wtf/Noncopyable.h" |
+#include "wtf/RefCounted.h" |
+#include "wtf/Vector.h" |
+#include "wtf/text/WTFString.h" |
+#include <v8.h> |
+ |
+namespace blink { |
+ |
+class Dictionary; |
+class Response; |
+class Request; |
+class ScriptState; |
+class WebServiceWorkerCache; |
+ |
+// See https://slightlyoff.github.io/ServiceWorker/spec/service_worker/index.html#cache |
falken
2014/08/06 04:46:28
Please move this comment to the .idl file. Our oth
gavinp
2014/08/08 19:55:26
Ahh, good point. I'll also upload a style CL to mo
|
+ |
+class Cache FINAL : public RefCountedWillBeGarbageCollected<Cache>, public ScriptWrappable { |
+ WTF_MAKE_NONCOPYABLE(Cache); |
+public: |
+ static PassRefPtrWillBeRawPtr<Cache> fromWebServiceWorkerCache(WebServiceWorkerCache*); |
+ |
+ // From Cache.idl: |
+ ScriptPromise match(ScriptState*, Request*, const Dictionary& queryParams); |
+ ScriptPromise match(ScriptState*, const String&, const Dictionary& queryParams); |
+ ScriptPromise matchAll(ScriptState*, Request*, const Dictionary& queryParams); |
+ ScriptPromise matchAll(ScriptState*, const String&, const Dictionary& queryParams); |
+ ScriptPromise add(ScriptState*, Request*); |
+ ScriptPromise add(ScriptState*, const String&); |
+ ScriptPromise addAll(ScriptState*, const WillBeHeapVector<ScriptValue>&); |
+ ScriptPromise deleteFunction(ScriptState*, Request*, const Dictionary& queryParams); |
+ ScriptPromise deleteFunction(ScriptState*, const String&, const Dictionary& queryParams); |
+ ScriptPromise put(ScriptState*, Request*, Response*); |
+ ScriptPromise put(ScriptState*, const String&, Response*); |
+ ScriptPromise keys(ScriptState*); |
+ ScriptPromise keys(ScriptState*, Request*, const Dictionary& queryParams); |
+ ScriptPromise keys(ScriptState*, const String&, const Dictionary& queryParams); |
+ |
+ void trace(Visitor*) { } |
+ |
+private: |
+ explicit Cache(WebServiceWorkerCache* webCache); |
+ |
+ WebServiceWorkerCache const* ALLOW_UNUSED m_webCache; |
+}; |
+ |
+} // namespace blink |
+ |
+#endif // Cache_h |