Index: public/platform/WebServiceWorkerCacheStorage.h |
diff --git a/public/platform/WebServiceWorkerCacheStorage.h b/public/platform/WebServiceWorkerCacheStorage.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..05c05e30271dc7a544a7f2af547d5079157db834 |
--- /dev/null |
+++ b/public/platform/WebServiceWorkerCacheStorage.h |
@@ -0,0 +1,45 @@ |
+// 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/WebString.h" |
+#include "public/platform/WebVector.h" |
+ |
+namespace WebCore { class ServiceWorker; } |
michaeln
2014/07/25 20:25:19
needed?
gavinp
2014/07/28 02:10:17
Nope.
|
+ |
+namespace blink { |
+ |
+// An interface to the CacheStorage API, implemented by the embedder and passed in to blink. |
michaeln
2014/07/25 20:25:19
very helpful to describe who implements vs who con
gavinp
2014/07/28 02:10:17
Just tried to make the comment more verbose; does
|
+class WebServiceWorkerCacheStorage { |
+public: |
+ enum CacheStorageError { |
+ CacheStorageErrorNotImplemented, |
+ CacheStorageErrorNotFound, |
+ CacheStorageErrorExists, |
+ CacheStorageErrorLast = CacheStorageErrorExists |
+ }; |
+ |
+ typedef WebCallbacks<void, CacheStorageError> CacheStorageCallbacks; |
+ typedef WebCallbacks<int /* cacheID */, CacheStorageError> CacheStorageWithCacheCallbacks; |
+ typedef WebCallbacks<WebVector<WebString>, CacheStorageError> CacheStorageKeysCallbacks; |
+ |
+ WebServiceWorkerCacheStorage() { } |
+ virtual ~WebServiceWorkerCacheStorage() { } |
+ |
+ // Ownership of the CacheStorage*Callbacks methods passes to the WebServiceWorkerCacheStorage |
+ // instance, which will delete it after calling onSuccess or onFailure. |
+ virtual void dispatchCreate(CacheStorageWithCacheCallbacks*, const WebString& key) = 0; |
+ virtual void dispatchRename(CacheStorageCallbacks*, const WebString& oldKey, const WebString& newKey) = 0; |
+ virtual void dispatchGet(CacheStorageWithCacheCallbacks*, const WebString& key) = 0; |
+ virtual void dispatchDelete(CacheStorageCallbacks*, const WebString& key) = 0; |
+ virtual void dispatchKeys(CacheStorageKeysCallbacks*) = 0; |
+}; |
+ |
+} // namespace blink |
+ |
+#endif // WebServiceWorkerCacheStorage_h |