| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "base/task.h" | 10 #include "base/task.h" |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 | 35 |
| 36 // Notifications of interesting events for a given entry. | 36 // Notifications of interesting events for a given entry. |
| 37 void OnOpenEntry(EntryImpl* entry); | 37 void OnOpenEntry(EntryImpl* entry); |
| 38 void OnCreateEntry(EntryImpl* entry); | 38 void OnCreateEntry(EntryImpl* entry); |
| 39 void OnDoomEntry(EntryImpl* entry); | 39 void OnDoomEntry(EntryImpl* entry); |
| 40 void OnDestroyEntry(EntryImpl* entry); | 40 void OnDestroyEntry(EntryImpl* entry); |
| 41 | 41 |
| 42 private: | 42 private: |
| 43 void ReportTrimTimes(EntryImpl* entry); | 43 void ReportTrimTimes(EntryImpl* entry); |
| 44 Rankings::List GetListForEntry(EntryImpl* entry); | 44 Rankings::List GetListForEntry(EntryImpl* entry); |
| 45 bool EvictEntry(CacheRankingsBlock* node, bool empty); |
| 46 |
| 47 // We'll just keep for a while a separate set of methods that implement the |
| 48 // new eviction algorithm. This code will replace the original methods when |
| 49 // finished. |
| 50 void TrimCacheV2(bool empty); |
| 51 void UpdateRankV2(EntryImpl* entry, bool modified); |
| 52 void OnOpenEntryV2(EntryImpl* entry); |
| 53 void OnCreateEntryV2(EntryImpl* entry); |
| 54 void OnDoomEntryV2(EntryImpl* entry); |
| 55 void OnDestroyEntryV2(EntryImpl* entry); |
| 56 Rankings::List GetListForEntryV2(EntryImpl* entry); |
| 57 void TrimDeleted(bool empty); |
| 58 |
| 59 bool NodeIsOldEnough(CacheRankingsBlock* node, int list); |
| 60 int SelectListByLenght(); |
| 45 | 61 |
| 46 BackendImpl* backend_; | 62 BackendImpl* backend_; |
| 47 Rankings* rankings_; | 63 Rankings* rankings_; |
| 48 IndexHeader* header_; | 64 IndexHeader* header_; |
| 49 int max_size_; | 65 int max_size_; |
| 66 bool new_eviction_; |
| 50 ScopedRunnableMethodFactory<Eviction> factory_; | 67 ScopedRunnableMethodFactory<Eviction> factory_; |
| 51 | 68 |
| 52 DISALLOW_COPY_AND_ASSIGN(Eviction); | 69 DISALLOW_COPY_AND_ASSIGN(Eviction); |
| 53 }; | 70 }; |
| 54 | 71 |
| 55 } // namespace disk_cache | 72 } // namespace disk_cache |
| 56 | 73 |
| 57 #endif // NET_DISK_CACHE_EVICTION_H_ | 74 #endif // NET_DISK_CACHE_EVICTION_H_ |
| OLD | NEW |