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; |