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

Unified Diff: public/platform/WebServiceWorkerCacheStorage.h

Issue 424643002: Introducing the WebServiceWorkerCacheStorage (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: remediate to falken review 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: public/platform/WebServiceWorkerCacheStorage.h
diff --git a/public/platform/WebServiceWorkerCacheStorage.h b/public/platform/WebServiceWorkerCacheStorage.h
new file mode 100644
index 0000000000000000000000000000000000000000..6de34c99cb39d40a07c9af45d26e6b7a8eff6080
--- /dev/null
+++ b/public/platform/WebServiceWorkerCacheStorage.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 WebServiceWorkerCacheStorage_h
+#define WebServiceWorkerCacheStorage_h
+
+#include "WebCommon.h"
+#include "public/platform/WebCallbacks.h"
+#include "public/platform/WebServiceWorkerCacheError.h"
+#include "public/platform/WebString.h"
+#include "public/platform/WebVector.h"
+
+namespace blink {
+
+class WebServiceWorkerCache;
+
+// An interface to the CacheStorage 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 WebServiceWorkerCacheStorage {
+public:
+ typedef WebCallbacks<void, WebServiceWorkerCacheError> CacheStorageCallbacks;
+ typedef WebCallbacks<WebServiceWorkerCache, WebServiceWorkerCacheError> CacheStorageWithCacheCallbacks;
+ typedef WebCallbacks<WebVector<WebString>, WebServiceWorkerCacheError> CacheStorageKeysCallbacks;
+
+ WebServiceWorkerCacheStorage() { }
jochen (gone - plz use gerrit) 2014/08/05 08:51:56 nit. no need for a ctor
+ virtual ~WebServiceWorkerCacheStorage() { }
+
+ // Ownership of the CacheStorage*Callbacks methods passes to the WebServiceWorkerCacheStorage
+ // instance, which will delete it after calling onSuccess or onFailure.
+ virtual void dispatchGet(CacheStorageWithCacheCallbacks*, const WebString& cacheName) = 0;
+ virtual void dispatchHas(CacheStorageCallbacks*, const WebString& cacheName) = 0;
+ virtual void dispatchCreate(CacheStorageWithCacheCallbacks*, const WebString& cacheName) = 0;
+ virtual void dispatchDelete(CacheStorageCallbacks*, const WebString& cacheName) = 0;
+ virtual void dispatchKeys(CacheStorageKeysCallbacks*) = 0;
+};
+
+} // namespace blink
+
+#endif // WebServiceWorkerCacheStorage_h

Powered by Google App Engine
This is Rietveld 408576698