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

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

Issue 424643002: Introducing the WebServiceWorkerCacheStorage (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: combine with prior CL 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/FetchStores.h
diff --git a/Source/modules/serviceworkers/FetchStores.h b/Source/modules/serviceworkers/FetchStores.h
new file mode 100644
index 0000000000000000000000000000000000000000..4f629a604c5c16cdbb68b9926c089c1c348c59c3
--- /dev/null
+++ b/Source/modules/serviceworkers/FetchStores.h
@@ -0,0 +1,41 @@
+// 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 FetchStores_h
+#define FetchStores_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"
+
+namespace blink {
+
+class WebServiceWorkerFetchStores;
+
+// See https://slightlyoff.github.io/ServiceWorker/spec/service_worker/index.html#cache-storage
+class FetchStores FINAL : public RefCountedWillBeGarbageCollected<FetchStores>, public ScriptWrappable {
+ WTF_MAKE_NONCOPYABLE(FetchStores);
+public:
+ static PassRefPtrWillBeRawPtr<FetchStores> create(blink::WebServiceWorkerFetchStores*);
+
+ ScriptPromise get(ScriptState*, const String& fetchStoreName);
+ ScriptPromise has(ScriptState*, const String& fetchStoreName);
+ ScriptPromise createFunction(ScriptState*, const String& fetchStoreName);
+ ScriptPromise deleteFunction(ScriptState*, const String& fetchStoreName);
+ ScriptPromise keys(ScriptState*);
+
+ void trace(Visitor*) { }
+
+private:
+ explicit FetchStores(blink::WebServiceWorkerFetchStores*);
+
+ blink::WebServiceWorkerFetchStores* m_webFetchStores;
+};
+
+} // namespace blink
+
+#endif // FetchStores_h

Powered by Google App Engine
This is Rietveld 408576698