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 CONTENT_BROWSER_CACHE_STORAGE_CACHE_STORAGE_H_ | 5 #ifndef CONTENT_BROWSER_CACHE_STORAGE_CACHE_STORAGE_H_ |
6 #define CONTENT_BROWSER_CACHE_STORAGE_CACHE_STORAGE_H_ | 6 #define CONTENT_BROWSER_CACHE_STORAGE_CACHE_STORAGE_H_ |
7 | 7 |
| 8 #include <stdint.h> |
| 9 |
8 #include <map> | 10 #include <map> |
9 #include <string> | 11 #include <string> |
10 | 12 |
11 #include "base/callback.h" | 13 #include "base/callback.h" |
12 #include "base/files/file_path.h" | 14 #include "base/files/file_path.h" |
| 15 #include "base/macros.h" |
13 #include "base/memory/ref_counted.h" | 16 #include "base/memory/ref_counted.h" |
14 #include "base/memory/weak_ptr.h" | 17 #include "base/memory/weak_ptr.h" |
15 #include "content/browser/cache_storage/cache_storage_cache.h" | 18 #include "content/browser/cache_storage/cache_storage_cache.h" |
16 | 19 |
17 namespace base { | 20 namespace base { |
18 class SequencedTaskRunner; | 21 class SequencedTaskRunner; |
19 } | 22 } |
20 | 23 |
21 namespace net { | 24 namespace net { |
22 class URLRequestContextGetter; | 25 class URLRequestContextGetter; |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 // CACHE_STORAGE_ERROR_NOT_FOUND. | 90 // CACHE_STORAGE_ERROR_NOT_FOUND. |
88 void MatchAllCaches(scoped_ptr<ServiceWorkerFetchRequest> request, | 91 void MatchAllCaches(scoped_ptr<ServiceWorkerFetchRequest> request, |
89 const CacheStorageCache::ResponseCallback& callback); | 92 const CacheStorageCache::ResponseCallback& callback); |
90 | 93 |
91 // Calls close on each cache and runs the callback after all of them have | 94 // Calls close on each cache and runs the callback after all of them have |
92 // closed. | 95 // closed. |
93 void CloseAllCaches(const base::Closure& callback); | 96 void CloseAllCaches(const base::Closure& callback); |
94 | 97 |
95 // The size of all of the origin's contents in memory. Returns 0 if the cache | 98 // The size of all of the origin's contents in memory. Returns 0 if the cache |
96 // backend is not a memory backend. Runs synchronously. | 99 // backend is not a memory backend. Runs synchronously. |
97 int64 MemoryBackedSize() const; | 100 int64_t MemoryBackedSize() const; |
98 | 101 |
99 // The functions below are for tests to verify that the operations run | 102 // The functions below are for tests to verify that the operations run |
100 // serially. | 103 // serially. |
101 void StartAsyncOperationForTesting(); | 104 void StartAsyncOperationForTesting(); |
102 void CompleteAsyncOperationForTesting(); | 105 void CompleteAsyncOperationForTesting(); |
103 | 106 |
104 private: | 107 private: |
105 friend class TestCacheStorage; | 108 friend class TestCacheStorage; |
106 | 109 |
107 class MemoryLoader; | 110 class MemoryLoader; |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
231 preserved_caches_; | 234 preserved_caches_; |
232 | 235 |
233 base::WeakPtrFactory<CacheStorage> weak_factory_; | 236 base::WeakPtrFactory<CacheStorage> weak_factory_; |
234 | 237 |
235 DISALLOW_COPY_AND_ASSIGN(CacheStorage); | 238 DISALLOW_COPY_AND_ASSIGN(CacheStorage); |
236 }; | 239 }; |
237 | 240 |
238 } // namespace content | 241 } // namespace content |
239 | 242 |
240 #endif // CONTENT_BROWSER_CACHE_STORAGE_CACHE_STORAGE_H_ | 243 #endif // CONTENT_BROWSER_CACHE_STORAGE_CACHE_STORAGE_H_ |
OLD | NEW |