summaryrefslogtreecommitdiffstats
path: root/net/disk_cache/rankings.h
diff options
context:
space:
mode:
authorrvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-17 21:34:17 +0000
committerrvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-17 21:34:17 +0000
commit7abcaea438b6205b44c1c4a51ebc4fa15ca74f9c (patch)
tree4547d7c2fafca13c3358dfb73014704326ecd8de /net/disk_cache/rankings.h
parent8893724b83008c83c89a87c2aa33157e8b012cb0 (diff)
downloadchromium_src-7abcaea438b6205b44c1c4a51ebc4fa15ca74f9c.zip
chromium_src-7abcaea438b6205b44c1c4a51ebc4fa15ca74f9c.tar.gz
chromium_src-7abcaea438b6205b44c1c4a51ebc4fa15ca74f9c.tar.bz2
Disk cache: A dirty entry can point to a list that
is not the actual list where the entry is stored. This CL recognizes that case and hanldes removing that entry from the lists, without saying that there is critical corruption. BUG=38859 TEST=net_unittests Review URL: http://codereview.chromium.org/5119001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@66518 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/disk_cache/rankings.h')
-rw-r--r--net/disk_cache/rankings.h12
1 files changed, 7 insertions, 5 deletions
diff --git a/net/disk_cache/rankings.h b/net/disk_cache/rankings.h
index 1914cf6..6066fbf 100644
--- a/net/disk_cache/rankings.h
+++ b/net/disk_cache/rankings.h
@@ -159,9 +159,10 @@ class Rankings {
// selfcheck).
bool CheckEntry(CacheRankingsBlock* rankings);
- // Returns false if node is not properly linked.
+ // Returns false if node is not properly linked. This method may change the
+ // provided |list| to reflect the list where this node is actually stored.
bool CheckLinks(CacheRankingsBlock* node, CacheRankingsBlock* prev,
- CacheRankingsBlock* next, List list);
+ CacheRankingsBlock* next, List* list);
// Checks the links between two consecutive nodes.
bool CheckSingleLink(CacheRankingsBlock* prev, CacheRankingsBlock* next);
@@ -170,9 +171,10 @@ class Rankings {
// error code (negative value).
int CheckList(List list);
- // Returns true if addr is the head or tail of any list.
- bool IsHead(CacheAddr addr);
- bool IsTail(CacheAddr addr);
+ // Returns true if addr is the head or tail of any list. When there is a
+ // match |list| will contain the list number for |addr|.
+ bool IsHead(CacheAddr addr, List* list);
+ bool IsTail(CacheAddr addr, List* list);
// Updates the iterators whenever node is being changed.
void UpdateIterators(CacheRankingsBlock* node);