OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CacheStorage_h | 5 #ifndef CacheStorage_h |
6 #define CacheStorage_h | 6 #define CacheStorage_h |
7 | 7 |
8 #include "bindings/core/v8/ScriptPromise.h" | 8 #include "bindings/core/v8/ScriptPromise.h" |
9 #include "bindings/core/v8/ScriptState.h" | 9 #include "bindings/core/v8/ScriptState.h" |
10 #include "bindings/core/v8/ScriptWrappable.h" | 10 #include "bindings/core/v8/ScriptWrappable.h" |
11 #include "wtf/Forward.h" | 11 #include "wtf/Forward.h" |
12 #include "wtf/Noncopyable.h" | 12 #include "wtf/Noncopyable.h" |
13 #include "wtf/RefCounted.h" | 13 #include "wtf/RefCounted.h" |
14 | 14 |
| 15 namespace blink { |
| 16 class WebServiceWorkerCacheStorage; |
| 17 } |
| 18 |
15 namespace WebCore { | 19 namespace WebCore { |
16 | 20 |
17 // See https://slightlyoff.github.io/ServiceWorker/spec/service_worker/index.htm
l#cache-storage | 21 // See https://slightlyoff.github.io/ServiceWorker/spec/service_worker/index.htm
l#cache-storage |
18 | 22 |
19 class CacheStorage FINAL : public RefCountedWillBeGarbageCollected<CacheStorage>
, public ScriptWrappable { | 23 class CacheStorage FINAL : public RefCountedWillBeGarbageCollected<CacheStorage>
, public ScriptWrappable { |
20 WTF_MAKE_NONCOPYABLE(CacheStorage); | 24 WTF_MAKE_NONCOPYABLE(CacheStorage); |
21 public: | 25 public: |
22 static PassRefPtrWillBeRawPtr<CacheStorage> create(); | 26 static PassRefPtrWillBeRawPtr<CacheStorage> create(blink::WebServiceWorkerCa
cheStorage*); |
23 | 27 |
24 ScriptPromise createFunction(ScriptState*, const String& key); | 28 ScriptPromise createFunction(ScriptState*, const String& key); |
25 ScriptPromise rename(ScriptState*, const String& oldKey, const String& newKe
y); | 29 ScriptPromise rename(ScriptState*, const String& oldKey, const String& newKe
y); |
26 ScriptPromise get(ScriptState*, const String& key); | 30 ScriptPromise get(ScriptState*, const String& key); |
27 ScriptPromise deleteFunction(ScriptState*, const String& key); | 31 ScriptPromise deleteFunction(ScriptState*, const String& key); |
28 ScriptPromise keys(ScriptState*); | 32 ScriptPromise keys(ScriptState*); |
29 | 33 |
30 void trace(Visitor*) { } | 34 void trace(Visitor*) { } |
31 | 35 |
32 private: | 36 private: |
33 CacheStorage(); | 37 explicit CacheStorage(blink::WebServiceWorkerCacheStorage*); |
| 38 |
| 39 blink::WebServiceWorkerCacheStorage* m_webCacheStorage; |
34 }; | 40 }; |
35 | 41 |
36 } // namespace WebCore | 42 } // namespace WebCore |
37 | 43 |
38 #endif // CacheStorage_h | 44 #endif // CacheStorage_h |
OLD | NEW |