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

Unified Diff: public/platform/WebServiceWorkerCacheStorage.h

Issue 380923002: Introducing the WebServiceWorkerCacheStorage. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase only 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
« no previous file with comments | « public/platform/WebServiceWorker.h ('k') | public/web/WebServiceWorkerContextClient.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: public/platform/WebServiceWorkerCacheStorage.h
diff --git a/public/platform/WebServiceWorkerCacheStorage.h b/public/platform/WebServiceWorkerCacheStorage.h
new file mode 100644
index 0000000000000000000000000000000000000000..4a3e4397afd58b0796ec0daa6f2c9de3b03eb84b
--- /dev/null
+++ b/public/platform/WebServiceWorkerCacheStorage.h
@@ -0,0 +1,46 @@
+// 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"
+#include <string>
+#include <vector>
falken 2014/07/23 04:56:10 Seems <string> and <vector> aren't used?
gavinp 2014/07/25 07:44:02 Done.
+
+namespace WebCore { class ServiceWorker; }
+
+namespace blink {
+
+// An interface to the CacheStorage API, implemented by the embedder and passed in to blink.
+class WebServiceWorkerCacheStorage {
+public:
+ enum ErrorReason {
+ CacheStorageErrorNotImplemented,
+ CacheStorageErrorNotFound,
+ CacheStorageErrorExists,
falken 2014/07/23 04:56:10 nit: enum values should be prefixed with the name
gavinp 2014/07/25 07:44:02 Done.
+ };
+
+ typedef WebCallbacks<void, ErrorReason> CacheStorageCallbacks;
+ typedef WebCallbacks<int /* cacheID */, ErrorReason> CacheStorageCreateCallbacks;
+ typedef WebCallbacks<WebVector<WebString>, ErrorReason> 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(CacheStorageCreateCallbacks*, const WebString& key) = 0;
+ virtual void dispatchRename(CacheStorageCallbacks*, const WebString& oldKey, const WebString& newKey) = 0;
+ virtual void dispatchGet(CacheStorageCallbacks*, const WebString& key) = 0;
+ virtual void dispatchDelete(CacheStorageCallbacks*, const WebString& key) = 0;
+ virtual void dispatchKeys(CacheStorageKeysCallbacks*) = 0;
+};
+
+} // namespace blink
+
+#endif // WebServiceWorkerCacheStorage_h
« no previous file with comments | « public/platform/WebServiceWorker.h ('k') | public/web/WebServiceWorkerContextClient.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698