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 "modules/cachestorage/Cache.h" | 11 #include "modules/cachestorage/Cache.h" |
12 #include "modules/cachestorage/CacheQueryOptions.h" | 12 #include "modules/cachestorage/CacheQueryOptions.h" |
13 #include "modules/fetch/GlobalFetch.h" | 13 #include "modules/fetch/GlobalFetch.h" |
14 #include "public/platform/modules/serviceworker/WebServiceWorkerCacheStorage.h" | 14 #include "public/platform/modules/serviceworker/WebServiceWorkerCacheStorage.h" |
15 #include "wtf/Forward.h" | 15 #include "wtf/Forward.h" |
16 #include "wtf/HashMap.h" | 16 #include "wtf/HashMap.h" |
17 #include "wtf/Noncopyable.h" | 17 #include "wtf/Noncopyable.h" |
| 18 #include <memory> |
18 | 19 |
19 namespace blink { | 20 namespace blink { |
20 | 21 |
21 class Cache; | 22 class Cache; |
22 class WebServiceWorkerCacheStorage; | 23 class WebServiceWorkerCacheStorage; |
23 | 24 |
24 class CacheStorage final : public GarbageCollectedFinalized<CacheStorage>, publi
c ScriptWrappable { | 25 class CacheStorage final : public GarbageCollectedFinalized<CacheStorage>, publi
c ScriptWrappable { |
25 DEFINE_WRAPPERTYPEINFO(); | 26 DEFINE_WRAPPERTYPEINFO(); |
26 WTF_MAKE_NONCOPYABLE(CacheStorage); | 27 WTF_MAKE_NONCOPYABLE(CacheStorage); |
27 public: | 28 public: |
(...skipping 12 matching lines...) Expand all Loading... |
40 private: | 41 private: |
41 class Callbacks; | 42 class Callbacks; |
42 class WithCacheCallbacks; | 43 class WithCacheCallbacks; |
43 class DeleteCallbacks; | 44 class DeleteCallbacks; |
44 class KeysCallbacks; | 45 class KeysCallbacks; |
45 class MatchCallbacks; | 46 class MatchCallbacks; |
46 | 47 |
47 friend class WithCacheCallbacks; | 48 friend class WithCacheCallbacks; |
48 friend class DeleteCallbacks; | 49 friend class DeleteCallbacks; |
49 | 50 |
50 CacheStorage(GlobalFetch::ScopedFetcher*, PassOwnPtr<WebServiceWorkerCacheSt
orage>); | 51 CacheStorage(GlobalFetch::ScopedFetcher*, std::unique_ptr<WebServiceWorkerCa
cheStorage>); |
51 ScriptPromise matchImpl(ScriptState*, const Request*, const CacheQueryOption
s&); | 52 ScriptPromise matchImpl(ScriptState*, const Request*, const CacheQueryOption
s&); |
52 | 53 |
53 Member<GlobalFetch::ScopedFetcher> m_scopedFetcher; | 54 Member<GlobalFetch::ScopedFetcher> m_scopedFetcher; |
54 OwnPtr<WebServiceWorkerCacheStorage> m_webCacheStorage; | 55 std::unique_ptr<WebServiceWorkerCacheStorage> m_webCacheStorage; |
55 HeapHashMap<String, Member<Cache>> m_nameToCacheMap; | 56 HeapHashMap<String, Member<Cache>> m_nameToCacheMap; |
56 }; | 57 }; |
57 | 58 |
58 } // namespace blink | 59 } // namespace blink |
59 | 60 |
60 #endif // CacheStorage_h | 61 #endif // CacheStorage_h |
OLD | NEW |