Chromium Code Reviews| Index: net/disk_cache/rankings.h |
| =================================================================== |
| --- net/disk_cache/rankings.h (revision 133063) |
| +++ net/disk_cache/rankings.h (working copy) |
| @@ -1,4 +1,4 @@ |
| -// Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| +// Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| @@ -146,6 +146,11 @@ |
| typedef std::pair<CacheAddr, CacheRankingsBlock*> IteratorPair; |
| typedef std::list<IteratorPair> IteratorList; |
| + enum ListDirection { |
|
gavinp
2012/04/26 15:46:54
Maybe name this ForwardsOrBackwards ?
rvargas (doing something else)
2012/04/27 00:18:10
The name of a type should express what the type is
|
| + FORWARD, |
| + BACKWARD |
| + }; |
| + |
| void ReadHeads(); |
| void ReadTails(); |
| void WriteHead(List list); |
| @@ -164,10 +169,6 @@ |
| void FinishInsert(CacheRankingsBlock* rankings); |
| void RevertRemove(CacheRankingsBlock* rankings); |
| - // Returns false if this entry will not be recognized as dirty (called during |
| - // selfcheck). |
| - bool CheckEntry(CacheRankingsBlock* rankings); |
| - |
| // 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, |
| @@ -180,6 +181,13 @@ |
| // error code (negative value). |
| int CheckList(List list); |
| + // Walks a list in the desired direction until |stop1| or |stop2| nodes are |
|
gavinp
2012/04/26 15:46:54
I like "end", as it's used in the standard library
|
| + // reached. Returns an error code (0 on success), the number of items verified |
| + // and the addresses of the last nodes visited (|last2| was seen before |
|
gavinp
2012/04/26 15:46:54
how about |second_last| and |last|?
|
| + // |last1|). |
| + int CheckListSection(List list, Addr stop1, Addr stop2, ListDirection dir, |
| + Addr* last1, Addr* last2, int* num_items); |
| + |
| // 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) const; |