Index: net/disk_cache/backend_impl.h |
=================================================================== |
--- net/disk_cache/backend_impl.h (revision 71365) |
+++ net/disk_cache/backend_impl.h (working copy) |
@@ -240,6 +240,14 @@ |
// Starts or stops throttling requests. |
void ThrottleRequestsForTest(bool throttle); |
+ // Trims an entry (all if |empty| is true) from the list of deleted |
+ // entries. This method should be called directly on the cache thread. |
+ void TrimForTest(bool empty); |
+ |
+ // Trims an entry (all if |empty| is true) from the list of deleted |
+ // entries. This method should be called directly on the cache thread. |
+ void TrimDeletedListForTest(bool empty); |
+ |
// Peforms a simple self-check, and returns the number of dirty items |
// or an error code (negative value). |
int SelfCheck(); |
@@ -280,8 +288,13 @@ |
// Returns a given entry from the cache. The entry to match is determined by |
// key and hash, and the returned entry may be the matched one or it's parent |
- // on the list of entries with the same hash (or bucket). |
- EntryImpl* MatchEntry(const std::string& key, uint32 hash, bool find_parent); |
+ // on the list of entries with the same hash (or bucket). To look for a parent |
+ // of a given entry, |entry_addr| should be grabbed from that entry, so that |
+ // if it doesn't match the entry on the index, we know that it was replaced |
+ // with a new entry; in this case |*match_error| will be set to true and the |
+ // return value will be NULL. |
+ EntryImpl* MatchEntry(const std::string& key, uint32 hash, bool find_parent, |
+ Addr entry_addr, bool* match_error); |
// Opens the next or previous entry on a cache iteration. |
EntryImpl* OpenFollowingEntry(bool forward, void** iter); |
@@ -293,9 +306,8 @@ |
CacheRankingsBlock** from_entry, |
EntryImpl** next_entry); |
- // Returns the entry that is pointed by |next|. If we are trimming the cache, |
- // |to_evict| should be true so that we don't perform extra disk writes. |
- EntryImpl* GetEnumeratedEntry(CacheRankingsBlock* next, bool to_evict); |
+ // Returns the entry that is pointed by |next|. |
+ EntryImpl* GetEnumeratedEntry(CacheRankingsBlock* next); |
// Re-opens an entry that was previously deleted. |
EntryImpl* ResurrectEntry(EntryImpl* deleted_entry); |