| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // See net/disk_cache/disk_cache.h for the public interface of the cache. | 5 // See net/disk_cache/disk_cache.h for the public interface of the cache. |
| 6 | 6 |
| 7 #ifndef NET_DISK_CACHE_BLOCKFILE_BACKEND_IMPL_V3_H_ | 7 #ifndef NET_DISK_CACHE_BLOCKFILE_BACKEND_IMPL_V3_H_ |
| 8 #define NET_DISK_CACHE_BLOCKFILE_BACKEND_IMPL_V3_H_ | 8 #define NET_DISK_CACHE_BLOCKFILE_BACKEND_IMPL_V3_H_ |
| 9 | 9 |
| 10 #include <stdint.h> | 10 #include <stdint.h> |
| 11 | 11 |
| 12 #include "base/containers/hash_tables.h" | 12 #include <unordered_map> |
| 13 |
| 13 #include "base/files/file_path.h" | 14 #include "base/files/file_path.h" |
| 14 #include "base/macros.h" | 15 #include "base/macros.h" |
| 15 #include "base/memory/ref_counted.h" | 16 #include "base/memory/ref_counted.h" |
| 16 #include "base/timer/timer.h" | 17 #include "base/timer/timer.h" |
| 17 #include "net/disk_cache/blockfile/block_bitmaps_v3.h" | 18 #include "net/disk_cache/blockfile/block_bitmaps_v3.h" |
| 18 #include "net/disk_cache/blockfile/block_files.h" | 19 #include "net/disk_cache/blockfile/block_files.h" |
| 19 #include "net/disk_cache/blockfile/eviction_v3.h" | 20 #include "net/disk_cache/blockfile/eviction_v3.h" |
| 20 #include "net/disk_cache/blockfile/index_table_v3.h" | 21 #include "net/disk_cache/blockfile/index_table_v3.h" |
| 21 #include "net/disk_cache/blockfile/stats.h" | 22 #include "net/disk_cache/blockfile/stats.h" |
| 22 #include "net/disk_cache/blockfile/stress_support.h" | 23 #include "net/disk_cache/blockfile/stress_support.h" |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 const CompletionCallback& callback) override; | 192 const CompletionCallback& callback) override; |
| 192 int DoomEntriesSince(base::Time initial_time, | 193 int DoomEntriesSince(base::Time initial_time, |
| 193 const CompletionCallback& callback) override; | 194 const CompletionCallback& callback) override; |
| 194 int CalculateSizeOfAllEntries(const CompletionCallback& callback) override; | 195 int CalculateSizeOfAllEntries(const CompletionCallback& callback) override; |
| 195 scoped_ptr<Iterator> CreateIterator() override; | 196 scoped_ptr<Iterator> CreateIterator() override; |
| 196 void GetStats(StatsItems* stats) override; | 197 void GetStats(StatsItems* stats) override; |
| 197 void OnExternalCacheHit(const std::string& key) override; | 198 void OnExternalCacheHit(const std::string& key) override; |
| 198 | 199 |
| 199 private: | 200 private: |
| 200 friend class EvictionV3; | 201 friend class EvictionV3; |
| 201 typedef base::hash_map<CacheAddr, EntryImplV3*> EntriesMap; | 202 using EntriesMap = std::unordered_map<CacheAddr, EntryImplV3*>; |
| 202 class IteratorImpl; | 203 class IteratorImpl; |
| 203 class NotImplementedIterator; | 204 class NotImplementedIterator; |
| 204 class Worker; | 205 class Worker; |
| 205 | 206 |
| 206 void AdjustMaxCacheSize(); | 207 void AdjustMaxCacheSize(); |
| 207 bool InitStats(void* stats_data); | 208 bool InitStats(void* stats_data); |
| 208 void StoreStats(); | 209 void StoreStats(); |
| 209 | 210 |
| 210 // Deletes the cache and starts again. | 211 // Deletes the cache and starts again. |
| 211 void RestartCache(bool failure); | 212 void RestartCache(bool failure); |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 278 scoped_ptr<base::RepeatingTimer> timer_; // Usage timer. | 279 scoped_ptr<base::RepeatingTimer> timer_; // Usage timer. |
| 279 scoped_refptr<TraceObject> trace_object_; // Initializes internal tracing. | 280 scoped_refptr<TraceObject> trace_object_; // Initializes internal tracing. |
| 280 base::WeakPtrFactory<BackendImplV3> ptr_factory_; | 281 base::WeakPtrFactory<BackendImplV3> ptr_factory_; |
| 281 | 282 |
| 282 DISALLOW_COPY_AND_ASSIGN(BackendImplV3); | 283 DISALLOW_COPY_AND_ASSIGN(BackendImplV3); |
| 283 }; | 284 }; |
| 284 | 285 |
| 285 } // namespace disk_cache | 286 } // namespace disk_cache |
| 286 | 287 |
| 287 #endif // NET_DISK_CACHE_BLOCKFILE_BACKEND_IMPL_V3_H_ | 288 #endif // NET_DISK_CACHE_BLOCKFILE_BACKEND_IMPL_V3_H_ |
| OLD | NEW |