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

Unified Diff: Source/modules/serviceworkers/FetchStore.h

Issue 434543002: Introducing the ServiceWorker Cache object. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 5 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/FetchStore.h
diff --git a/Source/modules/serviceworkers/FetchStore.h b/Source/modules/serviceworkers/FetchStore.h
new file mode 100644
index 0000000000000000000000000000000000000000..cf3c3b706ff3014bd33c8e6655e25f56c5124edd
--- /dev/null
+++ b/Source/modules/serviceworkers/FetchStore.h
@@ -0,0 +1,57 @@
+// 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 FetchStore_h
+#define FetchStore_h
+
+#include "bindings/core/v8/ScriptPromise.h"
+#include "bindings/core/v8/ScriptState.h"
+#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;
+
+// See https://slightlyoff.github.io/ServiceWorker/spec/service_worker/index.html#cache
falken 2014/07/31 15:28:21 This comment is better in the IDL file.
+
+class FetchStore FINAL : public RefCountedWillBeGarbageCollected<FetchStore>, public ScriptWrappable {
+ WTF_MAKE_NONCOPYABLE(FetchStore);
+public:
+ static PassRefPtrWillBeRawPtr<FetchStore> create(int fetchStoreID);
+
+ // From FetchStore.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*, 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);
+ ScriptPromise batch(ScriptState*, const Vector<Dictionary>& queryParams);
+
+ void trace(Visitor*) { }
+
+private:
+ explicit FetchStore(int fetchStoreID);
+
+ const int ALLOW_UNUSED m_fetchStoreID;
+};
+
+} // namespace blink
+
+#endif // FetchStore_h

Powered by Google App Engine
This is Rietveld 408576698