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

Unified Diff: public/platform/WebServiceWorkerFetchStores.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: public/platform/WebServiceWorkerFetchStores.h
diff --git a/public/platform/WebServiceWorkerFetchStores.h b/public/platform/WebServiceWorkerFetchStores.h
new file mode 100644
index 0000000000000000000000000000000000000000..050aef5522b57c41a688c17df6098032c730c6dd
--- /dev/null
+++ b/public/platform/WebServiceWorkerFetchStores.h
@@ -0,0 +1,40 @@
+// 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 WebServiceWorkerFetchStores_h
+#define WebServiceWorkerFetchStores_h
+
+#include "WebCommon.h"
+#include "public/platform/WebCallbacks.h"
+#include "public/platform/WebServiceWorkerFetchStoresError.h"
+#include "public/platform/WebString.h"
+#include "public/platform/WebVector.h"
+
+namespace blink {
+
+// An interface to the FetchStores API, implemented by the embedder and passed in to blink. Blink's implementation
+// of the ServiceWorker spec will call these methods to create/open caches, and expect callbacks from the embedder
+// after operations complete.
+class WebServiceWorkerFetchStores {
+public:
+
+ typedef WebCallbacks<void, WebServiceWorkerFetchStoresError> FetchStoresCallbacks;
+ typedef WebCallbacks<int /* fetchStoreID */, WebServiceWorkerFetchStoresError> FetchStoresWithFetchStoreCallbacks;
+ typedef WebCallbacks<WebVector<WebString>, WebServiceWorkerFetchStoresError> FetchStoresKeysCallbacks;
+
+ WebServiceWorkerFetchStores() { }
+ virtual ~WebServiceWorkerFetchStores() { }
+
+ // Ownership of the FetchStores*Callbacks methods passes to the WebServiceWorkerFetchStores
+ // instance, which will delete it after calling onSuccess or onFailure.
+ virtual void dispatchGet(FetchStoresWithFetchStoreCallbacks*, const WebString& fetchStoreName) = 0;
+ virtual void dispatchHas(FetchStoresCallbacks*, const WebString& fetchStoreName) = 0;
+ virtual void dispatchCreate(FetchStoresWithFetchStoreCallbacks*, const WebString& fetchStoreName) = 0;
+ virtual void dispatchDelete(FetchStoresCallbacks*, const WebString& fetchStoreName) = 0;
+ virtual void dispatchKeys(FetchStoresKeysCallbacks*) = 0;
+};
+
+} // namespace blink
+
+#endif // WebServiceWorkerFetchStores_h

Powered by Google App Engine
This is Rietveld 408576698