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_H_ | 7 #ifndef NET_DISK_CACHE_BLOCKFILE_BACKEND_IMPL_H_ |
8 #define NET_DISK_CACHE_BLOCKFILE_BACKEND_IMPL_H_ | 8 #define NET_DISK_CACHE_BLOCKFILE_BACKEND_IMPL_H_ |
9 | 9 |
10 #include "base/containers/hash_tables.h" | 10 #include "base/containers/hash_tables.h" |
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
242 | 242 |
243 // Trims an entry (all if |empty| is true) from the list of deleted | 243 // Trims an entry (all if |empty| is true) from the list of deleted |
244 // entries. This method should be called directly on the cache thread. | 244 // entries. This method should be called directly on the cache thread. |
245 void TrimForTest(bool empty); | 245 void TrimForTest(bool empty); |
246 | 246 |
247 // Trims an entry (all if |empty| is true) from the list of deleted | 247 // Trims an entry (all if |empty| is true) from the list of deleted |
248 // entries. This method should be called directly on the cache thread. | 248 // entries. This method should be called directly on the cache thread. |
249 void TrimDeletedListForTest(bool empty); | 249 void TrimDeletedListForTest(bool empty); |
250 | 250 |
251 // Only intended for testing | 251 // Only intended for testing |
252 base::RepeatingTimer<BackendImpl>* GetTimerForTest(); | 252 base::RepeatingTimer* GetTimerForTest(); |
253 | 253 |
254 // Performs a simple self-check, and returns the number of dirty items | 254 // Performs a simple self-check, and returns the number of dirty items |
255 // or an error code (negative value). | 255 // or an error code (negative value). |
256 int SelfCheck(); | 256 int SelfCheck(); |
257 | 257 |
258 // Ensures the index is flushed to disk (a no-op on platforms with mmap). | 258 // Ensures the index is flushed to disk (a no-op on platforms with mmap). |
259 void FlushIndex(); | 259 void FlushIndex(); |
260 | 260 |
261 // Backend implementation. | 261 // Backend implementation. |
262 net::CacheType GetCacheType() const override; | 262 net::CacheType GetCacheType() const override; |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
388 bool unit_test_; | 388 bool unit_test_; |
389 bool read_only_; // Prevents updates of the rankings data (used by tools). | 389 bool read_only_; // Prevents updates of the rankings data (used by tools). |
390 bool disabled_; | 390 bool disabled_; |
391 bool new_eviction_; // What eviction algorithm should be used. | 391 bool new_eviction_; // What eviction algorithm should be used. |
392 bool first_timer_; // True if the timer has not been called. | 392 bool first_timer_; // True if the timer has not been called. |
393 bool user_load_; // True if we see a high load coming from the caller. | 393 bool user_load_; // True if we see a high load coming from the caller. |
394 | 394 |
395 net::NetLog* net_log_; | 395 net::NetLog* net_log_; |
396 | 396 |
397 Stats stats_; // Usage statistics. | 397 Stats stats_; // Usage statistics. |
398 scoped_ptr<base::RepeatingTimer<BackendImpl> > timer_; // Usage timer. | 398 scoped_ptr<base::RepeatingTimer> timer_; // Usage timer. |
399 base::WaitableEvent done_; // Signals the end of background work. | 399 base::WaitableEvent done_; // Signals the end of background work. |
400 scoped_refptr<TraceObject> trace_object_; // Initializes internal tracing. | 400 scoped_refptr<TraceObject> trace_object_; // Initializes internal tracing. |
401 base::WeakPtrFactory<BackendImpl> ptr_factory_; | 401 base::WeakPtrFactory<BackendImpl> ptr_factory_; |
402 | 402 |
403 DISALLOW_COPY_AND_ASSIGN(BackendImpl); | 403 DISALLOW_COPY_AND_ASSIGN(BackendImpl); |
404 }; | 404 }; |
405 | 405 |
406 } // namespace disk_cache | 406 } // namespace disk_cache |
407 | 407 |
408 #endif // NET_DISK_CACHE_BLOCKFILE_BACKEND_IMPL_H_ | 408 #endif // NET_DISK_CACHE_BLOCKFILE_BACKEND_IMPL_H_ |
OLD | NEW |