Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(84)

Unified Diff: net/disk_cache/rankings.h

Issue 8065015: Disk Cache: Improve handling of dirty entries. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: net/disk_cache/rankings.h
===================================================================
--- net/disk_cache/rankings.h (revision 102424)
+++ net/disk_cache/rankings.h (working copy)
@@ -112,8 +112,12 @@
// Inserts a given entry at the head of the queue.
void Insert(CacheRankingsBlock* node, bool modified, List list);
- // Removes a given entry from the LRU list.
- void Remove(CacheRankingsBlock* node, List list);
+ // Removes a given entry from the LRU list. If |strict| is true, this method
+ // assumes that |node| is not pointed to by an active iterator. On the other
+ // hand, removing that restriction allows the current "head" of an iterator
+ // to be removed from the list (basically without control of the code that is
+ // performing the iteration), so it should be used with extra care.
+ void Remove(CacheRankingsBlock* node, List list, bool strict);
// Moves a given entry to the head.
void UpdateRank(CacheRankingsBlock* node, bool modified, List list);
@@ -132,8 +136,12 @@
// Returns false if the entry is clearly invalid. from_list is true if the
// node comes from the LRU list.
- bool SanityCheck(CacheRankingsBlock* node, bool from_list);
+ bool SanityCheck(CacheRankingsBlock* node, bool from_list) const;
+ bool DataSanityCheck(CacheRankingsBlock* node, bool from_list) const;
+ // Sets the |contents| field of |node| to |address|.
+ void SetContents(CacheRankingsBlock* node, CacheAddr address);
+
private:
typedef std::pair<CacheAddr, CacheRankingsBlock*> IteratorPair;
typedef std::list<IteratorPair> IteratorList;
@@ -174,8 +182,8 @@
// 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);
+ bool IsHead(CacheAddr addr, List* list) const;
+ bool IsTail(CacheAddr addr, List* list) const;
// Updates the iterators whenever node is being changed.
void UpdateIterators(CacheRankingsBlock* node);

Powered by Google App Engine
This is Rietveld 408576698