summaryrefslogtreecommitdiffstats
path: root/net/disk_cache/rankings.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/rankings.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/rankings.h')
-rw-r--r--net/disk_cache/rankings.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/net/disk_cache/rankings.h b/net/disk_cache/rankings.h
index 0a8b113..4e94237 100644
--- a/net/disk_cache/rankings.h
+++ b/net/disk_cache/rankings.h
@@ -127,6 +127,9 @@ class Rankings {
CacheRankingsBlock* GetPrev(CacheRankingsBlock* node, List list);
void FreeRankingsBlock(CacheRankingsBlock* node);
+ // Controls tracking of nodes used for enumerations.
+ void TrackRankingsBlock(CacheRankingsBlock* node, bool start_tracking);
+
// Peforms a simple self-check of the lists, and returns the number of items
// or an error code (negative value).
int SelfCheck();
@@ -171,14 +174,11 @@ class Rankings {
bool IsHead(CacheAddr addr);
bool IsTail(CacheAddr addr);
- // Controls tracking of nodes used for enumerations.
- void TrackRankingsBlock(CacheRankingsBlock* node, bool start_tracking);
-
// Updates the iterators whenever node is being changed.
void UpdateIterators(CacheRankingsBlock* node);
- // Verifies that no iterator gets invalidated by changing a node.
- void NotAnIterator(CacheRankingsBlock* node);
+ // Invalidates the iterators pointing to this node.
+ void InvalidateIterators(CacheRankingsBlock* node);
// Keeps track of the number of entries on a list.
void IncrementCounter(List list);