| 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 { | 15 namespace blink { |
| 16 | 16 |
| 17 class WebServiceWorkerCacheStorage; | 17 class WebServiceWorkerCacheStorage; |
| 18 | 18 |
| 19 // See https://slightlyoff.github.io/ServiceWorker/spec/service_worker/index.htm
l#cache-storage | 19 // See https://slightlyoff.github.io/ServiceWorker/spec/service_worker/index.htm
l#cache-storage |
| 20 class CacheStorage FINAL : public RefCountedWillBeGarbageCollected<CacheStorage>
, public ScriptWrappable { | 20 class CacheStorage FINAL : public RefCountedWillBeGarbageCollected<CacheStorage>
, public ScriptWrappable { |
| 21 WTF_MAKE_NONCOPYABLE(CacheStorage); | 21 WTF_MAKE_NONCOPYABLE(CacheStorage); |
| 22 public: | 22 public: |
| 23 static PassRefPtrWillBeRawPtr<CacheStorage> create(blink::WebServiceWorkerCa
cheStorage*); | 23 static PassRefPtrWillBeRawPtr<CacheStorage> create(WebServiceWorkerCacheStor
age*); |
| 24 | 24 |
| 25 ScriptPromise get(ScriptState*, const String& cacheName); | 25 ScriptPromise get(ScriptState*, const String& cacheName); |
| 26 ScriptPromise has(ScriptState*, const String& cacheName); | 26 ScriptPromise has(ScriptState*, const String& cacheName); |
| 27 ScriptPromise createFunction(ScriptState*, const String& cacheName); | 27 ScriptPromise createFunction(ScriptState*, const String& cacheName); |
| 28 ScriptPromise deleteFunction(ScriptState*, const String& cacheName); | 28 ScriptPromise deleteFunction(ScriptState*, const String& cacheName); |
| 29 ScriptPromise keys(ScriptState*); | 29 ScriptPromise keys(ScriptState*); |
| 30 | 30 |
| 31 void trace(Visitor*) { } | 31 void trace(Visitor*) { } |
| 32 | 32 |
| 33 private: | 33 private: |
| 34 explicit CacheStorage(blink::WebServiceWorkerCacheStorage*); | 34 explicit CacheStorage(WebServiceWorkerCacheStorage*); |
| 35 | 35 |
| 36 blink::WebServiceWorkerCacheStorage* m_webCacheStorage; | 36 WebServiceWorkerCacheStorage* m_webCacheStorage; |
| 37 }; | 37 }; |
| 38 | 38 |
| 39 } // namespace blink | 39 } // namespace blink |
| 40 | 40 |
| 41 #endif // CacheStorage_h | 41 #endif // CacheStorage_h |
| OLD | NEW |