Chromium Code Reviews| OLD | NEW |
|---|---|
| (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 | |
| 13 namespace WebCore { class ServiceWorker; } | |
|
michaeln
2014/07/25 20:25:19
needed?
gavinp
2014/07/28 02:10:17
Nope.
| |
| 14 | |
| 15 namespace blink { | |
| 16 | |
| 17 // 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
| |
| 18 class WebServiceWorkerCacheStorage { | |
| 19 public: | |
| 20 enum CacheStorageError { | |
| 21 CacheStorageErrorNotImplemented, | |
| 22 CacheStorageErrorNotFound, | |
| 23 CacheStorageErrorExists, | |
| 24 CacheStorageErrorLast = CacheStorageErrorExists | |
| 25 }; | |
| 26 | |
| 27 typedef WebCallbacks<void, CacheStorageError> CacheStorageCallbacks; | |
| 28 typedef WebCallbacks<int /* cacheID */, CacheStorageError> CacheStorageWithC acheCallbacks; | |
| 29 typedef WebCallbacks<WebVector<WebString>, CacheStorageError> CacheStorageKe ysCallbacks; | |
| 30 | |
| 31 WebServiceWorkerCacheStorage() { } | |
| 32 virtual ~WebServiceWorkerCacheStorage() { } | |
| 33 | |
| 34 // Ownership of the CacheStorage*Callbacks methods passes to the WebServiceW orkerCacheStorage | |
| 35 // instance, which will delete it after calling onSuccess or onFailure. | |
| 36 virtual void dispatchCreate(CacheStorageWithCacheCallbacks*, const WebString & key) = 0; | |
| 37 virtual void dispatchRename(CacheStorageCallbacks*, const WebString& oldKey, const WebString& newKey) = 0; | |
| 38 virtual void dispatchGet(CacheStorageWithCacheCallbacks*, const WebString& k ey) = 0; | |
| 39 virtual void dispatchDelete(CacheStorageCallbacks*, const WebString& key) = 0; | |
| 40 virtual void dispatchKeys(CacheStorageKeysCallbacks*) = 0; | |
| 41 }; | |
| 42 | |
| 43 } // namespace blink | |
| 44 | |
| 45 #endif // WebServiceWorkerCacheStorage_h | |
| OLD | NEW |