| 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_CACHE_H_ | 5 #ifndef CONTENT_BROWSER_CACHE_STORAGE_CACHE_STORAGE_CACHE_H_ |
| 6 #define CONTENT_BROWSER_CACHE_STORAGE_CACHE_STORAGE_CACHE_H_ | 6 #define CONTENT_BROWSER_CACHE_STORAGE_CACHE_STORAGE_CACHE_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 void Keys(const RequestsCallback& callback); | 100 void Keys(const RequestsCallback& callback); |
| 101 | 101 |
| 102 // Closes the backend. Future operations that require the backend | 102 // Closes the backend. Future operations that require the backend |
| 103 // will exit early. Close should only be called once per CacheStorageCache. | 103 // will exit early. Close should only be called once per CacheStorageCache. |
| 104 void Close(const base::Closure& callback); | 104 void Close(const base::Closure& callback); |
| 105 | 105 |
| 106 // The size of the cache contents in memory. Returns 0 if the cache backend is | 106 // The size of the cache contents in memory. Returns 0 if the cache backend is |
| 107 // not a memory cache backend. | 107 // not a memory cache backend. |
| 108 int64 MemoryBackedSize() const; | 108 int64 MemoryBackedSize() const; |
| 109 | 109 |
| 110 base::FilePath path() const { return path_; } |
| 111 |
| 110 base::WeakPtr<CacheStorageCache> AsWeakPtr(); | 112 base::WeakPtr<CacheStorageCache> AsWeakPtr(); |
| 111 | 113 |
| 112 private: | 114 private: |
| 113 friend class base::RefCounted<CacheStorageCache>; | 115 friend class base::RefCounted<CacheStorageCache>; |
| 114 friend class TestCacheStorageCache; | 116 friend class TestCacheStorageCache; |
| 115 | 117 |
| 116 struct OpenAllEntriesContext; | 118 struct OpenAllEntriesContext; |
| 117 struct MatchAllContext; | 119 struct MatchAllContext; |
| 118 struct KeysContext; | 120 struct KeysContext; |
| 119 struct PutContext; | 121 struct PutContext; |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 273 bool memory_only_; | 275 bool memory_only_; |
| 274 | 276 |
| 275 base::WeakPtrFactory<CacheStorageCache> weak_ptr_factory_; | 277 base::WeakPtrFactory<CacheStorageCache> weak_ptr_factory_; |
| 276 | 278 |
| 277 DISALLOW_COPY_AND_ASSIGN(CacheStorageCache); | 279 DISALLOW_COPY_AND_ASSIGN(CacheStorageCache); |
| 278 }; | 280 }; |
| 279 | 281 |
| 280 } // namespace content | 282 } // namespace content |
| 281 | 283 |
| 282 #endif // CONTENT_BROWSER_CACHE_STORAGE_CACHE_STORAGE_CACHE_H_ | 284 #endif // CONTENT_BROWSER_CACHE_STORAGE_CACHE_STORAGE_CACHE_H_ |
| OLD | NEW |