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

Unified Diff: net/disk_cache/rankings.cc

Issue 155590: Disk cache: Add support for having a sparse entry block that... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 5 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
« no previous file with comments | « net/disk_cache/rankings.h ('k') | net/disk_cache/sparse_control.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/disk_cache/rankings.cc
===================================================================
--- net/disk_cache/rankings.cc (revision 20517)
+++ net/disk_cache/rankings.cc (working copy)
@@ -394,6 +394,7 @@
// entry. Otherwise we'll need reentrant transactions, which is an overkill.
void Rankings::UpdateRank(CacheRankingsBlock* node, bool modified, List list) {
Time start = Time::Now();
+ NotAnIterator(node);
Remove(node, list);
Insert(node, modified, list);
CACHE_UMA(AGE_MS, "UpdateRank", 0, start);
@@ -754,6 +755,19 @@
}
}
+void Rankings::NotAnIterator(CacheRankingsBlock* node) {
+#ifdef NDEBUG
+ // This method is only enabled for debug builds.
+ return;
+#endif
+ CacheAddr address = node->address().value();
+ for (IteratorList::iterator it = iterators_.begin(); it != iterators_.end();
+ ++it) {
+ if (it->first == address)
+ NOTREACHED();
+ }
+}
+
void Rankings::IncrementCounter(List list) {
if (!count_lists_)
return;
« no previous file with comments | « net/disk_cache/rankings.h ('k') | net/disk_cache/sparse_control.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698