| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 NET_DISK_CACHE_EVICTION_H_ | 5 #ifndef NET_DISK_CACHE_EVICTION_H_ |
| 6 #define NET_DISK_CACHE_EVICTION_H_ | 6 #define NET_DISK_CACHE_EVICTION_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 void OnDestroyEntry(EntryImpl* entry); | 41 void OnDestroyEntry(EntryImpl* entry); |
| 42 | 42 |
| 43 // Testing interface. | 43 // Testing interface. |
| 44 void SetTestMode(); | 44 void SetTestMode(); |
| 45 void TrimDeletedList(bool empty); | 45 void TrimDeletedList(bool empty); |
| 46 | 46 |
| 47 private: | 47 private: |
| 48 void PostDelayedTrim(); | 48 void PostDelayedTrim(); |
| 49 void DelayedTrim(); | 49 void DelayedTrim(); |
| 50 bool ShouldTrim(); | 50 bool ShouldTrim(); |
| 51 bool ShouldTrimDeleted(); |
| 51 void ReportTrimTimes(EntryImpl* entry); | 52 void ReportTrimTimes(EntryImpl* entry); |
| 52 Rankings::List GetListForEntry(EntryImpl* entry); | 53 Rankings::List GetListForEntry(EntryImpl* entry); |
| 53 bool EvictEntry(CacheRankingsBlock* node, bool empty, Rankings::List list); | 54 bool EvictEntry(CacheRankingsBlock* node, bool empty, Rankings::List list); |
| 54 | 55 |
| 55 // We'll just keep for a while a separate set of methods that implement the | 56 // We'll just keep for a while a separate set of methods that implement the |
| 56 // new eviction algorithm. This code will replace the original methods when | 57 // new eviction algorithm. This code will replace the original methods when |
| 57 // finished. | 58 // finished. |
| 58 void TrimCacheV2(bool empty); | 59 void TrimCacheV2(bool empty); |
| 59 void UpdateRankV2(EntryImpl* entry, bool modified); | 60 void UpdateRankV2(EntryImpl* entry, bool modified); |
| 60 void OnOpenEntryV2(EntryImpl* entry); | 61 void OnOpenEntryV2(EntryImpl* entry); |
| (...skipping 21 matching lines...) Expand all Loading... |
| 82 bool test_mode_; | 83 bool test_mode_; |
| 83 bool in_experiment_; | 84 bool in_experiment_; |
| 84 base::WeakPtrFactory<Eviction> ptr_factory_; | 85 base::WeakPtrFactory<Eviction> ptr_factory_; |
| 85 | 86 |
| 86 DISALLOW_COPY_AND_ASSIGN(Eviction); | 87 DISALLOW_COPY_AND_ASSIGN(Eviction); |
| 87 }; | 88 }; |
| 88 | 89 |
| 89 } // namespace disk_cache | 90 } // namespace disk_cache |
| 90 | 91 |
| 91 #endif // NET_DISK_CACHE_EVICTION_H_ | 92 #endif // NET_DISK_CACHE_EVICTION_H_ |
| OLD | NEW |