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/task.h" | 10 #include "base/task.h" |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 void ReportTrimTimes(EntryImpl* entry); | 51 void ReportTrimTimes(EntryImpl* entry); |
52 Rankings::List GetListForEntry(EntryImpl* entry); | 52 Rankings::List GetListForEntry(EntryImpl* entry); |
53 bool EvictEntry(CacheRankingsBlock* node, bool empty); | 53 bool EvictEntry(CacheRankingsBlock* node, bool empty, Rankings::List list); |
54 | 54 |
55 // We'll just keep for a while a separate set of methods that implement the | 55 // 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 | 56 // new eviction algorithm. This code will replace the original methods when |
57 // finished. | 57 // finished. |
58 void TrimCacheV2(bool empty); | 58 void TrimCacheV2(bool empty); |
59 void UpdateRankV2(EntryImpl* entry, bool modified); | 59 void UpdateRankV2(EntryImpl* entry, bool modified); |
60 void OnOpenEntryV2(EntryImpl* entry); | 60 void OnOpenEntryV2(EntryImpl* entry); |
61 void OnCreateEntryV2(EntryImpl* entry); | 61 void OnCreateEntryV2(EntryImpl* entry); |
62 void OnDoomEntryV2(EntryImpl* entry); | 62 void OnDoomEntryV2(EntryImpl* entry); |
63 void OnDestroyEntryV2(EntryImpl* entry); | 63 void OnDestroyEntryV2(EntryImpl* entry); |
(...skipping 18 matching lines...) Expand all Loading... |
82 bool test_mode_; | 82 bool test_mode_; |
83 bool in_experiment_; | 83 bool in_experiment_; |
84 ScopedRunnableMethodFactory<Eviction> factory_; | 84 ScopedRunnableMethodFactory<Eviction> factory_; |
85 | 85 |
86 DISALLOW_COPY_AND_ASSIGN(Eviction); | 86 DISALLOW_COPY_AND_ASSIGN(Eviction); |
87 }; | 87 }; |
88 | 88 |
89 } // namespace disk_cache | 89 } // namespace disk_cache |
90 | 90 |
91 #endif // NET_DISK_CACHE_EVICTION_H_ | 91 #endif // NET_DISK_CACHE_EVICTION_H_ |
OLD | NEW |