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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « public/platform/WebServiceWorker.h ('k') | public/web/WebServiceWorkerContextClient.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef WebServiceWorkerCacheStorage_h
6 #define WebServiceWorkerCacheStorage_h
7
8 #include "WebCommon.h"
9 #include "public/platform/WebCallbacks.h"
10 #include "public/platform/WebString.h"
11 #include "public/platform/WebVector.h"
12 #include <string>
13 #include <vector>
falken 2014/07/23 04:56:10 Seems <string> and <vector> aren't used?
gavinp 2014/07/25 07:44:02 Done.
14
15 namespace WebCore { class ServiceWorker; }
16
17 namespace blink {
18
19 // An interface to the CacheStorage API, implemented by the embedder and passed in to blink.
20 class WebServiceWorkerCacheStorage {
21 public:
22 enum ErrorReason {
23 CacheStorageErrorNotImplemented,
24 CacheStorageErrorNotFound,
25 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.
26 };
27
28 typedef WebCallbacks<void, ErrorReason> CacheStorageCallbacks;
29 typedef WebCallbacks<int /* cacheID */, ErrorReason> CacheStorageCreateCallb acks;
30 typedef WebCallbacks<WebVector<WebString>, ErrorReason> CacheStorageKeysCall backs;
31
32 WebServiceWorkerCacheStorage() { }
33 virtual ~WebServiceWorkerCacheStorage() { }
34
35 // Ownership of the CacheStorage*Callbacks methods passes to the WebServiceW orkerCacheStorage
36 // instance, which will delete it after calling onSuccess or onFailure.
37 virtual void dispatchCreate(CacheStorageCreateCallbacks*, const WebString& k ey) = 0;
38 virtual void dispatchRename(CacheStorageCallbacks*, const WebString& oldKey, const WebString& newKey) = 0;
39 virtual void dispatchGet(CacheStorageCallbacks*, const WebString& key) = 0;
40 virtual void dispatchDelete(CacheStorageCallbacks*, const WebString& key) = 0;
41 virtual void dispatchKeys(CacheStorageKeysCallbacks*) = 0;
42 };
43
44 } // namespace blink
45
46 #endif // WebServiceWorkerCacheStorage_h
OLDNEW
« 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