summaryrefslogtreecommitdiffstats
path: root/net/disk_cache/backend_impl.h
diff options
context:
space:
mode:
authorrvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-23 00:37:15 +0000
committerrvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-23 00:37:15 +0000
commitf20920fc7d56aebfd9631318c2b0d1adf36c5a9e (patch)
tree907380abc63c04e1d5a1a93713132bba9814d338 /net/disk_cache/backend_impl.h
parentbded84c49d2944862dd2d009919ef6a272e8c5f2 (diff)
downloadchromium_src-f20920fc7d56aebfd9631318c2b0d1adf36c5a9e.zip
chromium_src-f20920fc7d56aebfd9631318c2b0d1adf36c5a9e.tar.gz
chromium_src-f20920fc7d56aebfd9631318c2b0d1adf36c5a9e.tar.bz2
Disk cache: Fix handling of invalid entries that are detected
when doing evictions or enumerations. This cl fixes an issue with dirty entries being deleted twice from disk, and improves the whole thing so that different flavors or corrupt entries are removed gracefully. We started deleting things twice when we created the map of currently-open entries, because we don't want to have dirty entries on that map, so it is possible to have multiple EntryImpl objects that refer to the same entry (for corrupt entries). BUG=17474 TEST=Unittests, stress_cache.exe Review URL: http://codereview.chromium.org/155951 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21360 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/disk_cache/backend_impl.h')
-rw-r--r--net/disk_cache/backend_impl.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/net/disk_cache/backend_impl.h b/net/disk_cache/backend_impl.h
index e53150e..ef282779 100644
--- a/net/disk_cache/backend_impl.h
+++ b/net/disk_cache/backend_impl.h
@@ -208,13 +208,15 @@ class BackendImpl : public Backend {
CacheRankingsBlock** from_entry,
EntryImpl** next_entry);
- // Returns the entry that is pointed by |next|.
- EntryImpl* GetEnumeratedEntry(CacheRankingsBlock* next);
+ // 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);
// Re-opens an entry that was previously deleted.
bool ResurrectEntry(EntryImpl* deleted_entry, Entry** entry);
- void DestroyInvalidEntry(Addr address, EntryImpl* entry);
+ void DestroyInvalidEntry(EntryImpl* entry);
+ void DestroyInvalidEntryFromEnumeration(EntryImpl* entry);
// Handles the used storage count.
void AddStorageSize(int32 bytes);