summaryrefslogtreecommitdiffstats
path: root/net/disk_cache/rankings.cc
diff options
context:
space:
mode:
authorrvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-02-23 00:55:38 +0000
committerrvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-02-23 00:55:38 +0000
commit5f274d2605f24ea29e80cab9a50af328b56c17b5 (patch)
tree031fba2d34a61667d952fd599773073a5c05f2e3 /net/disk_cache/rankings.cc
parent8f30af7229df2cdc5aeaa9969feb27fb7535e059 (diff)
downloadchromium_src-5f274d2605f24ea29e80cab9a50af328b56c17b5.zip
chromium_src-5f274d2605f24ea29e80cab9a50af328b56c17b5.tar.gz
chromium_src-5f274d2605f24ea29e80cab9a50af328b56c17b5.tar.bz2
Disk cache: More fixes to avoid corruption.
* We now keep dirty entries in the map of open entries so that we handle better crashes when we are working with dirty entries. * EntryImpl now remembers if the entry was dirty on disk. * When we find a dirty entry while doing enumerations we now go through the regular path to delete the entry (InternalDoomEntry), and let MatchEntry delete the entry. The main problem with the old code is that it was possible to delete the entry without first removing it from the index, so a crash at that time would leave references to free addresses. * Now we correctly consider the case of not finding an entry when looking for its parent as an error. BUG=62085 TEST=net_unittests Review URL: http://codereview.chromium.org/6538006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@75685 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/disk_cache/rankings.cc')
-rw-r--r--net/disk_cache/rankings.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/disk_cache/rankings.cc b/net/disk_cache/rankings.cc
index b10dac6..3644932 100644
--- a/net/disk_cache/rankings.cc
+++ b/net/disk_cache/rankings.cc
@@ -549,7 +549,7 @@ bool Rankings::GetRanking(CacheRankingsBlock* rankings) {
return true;
EntryImpl* entry = backend_->GetOpenEntry(rankings);
- if (backend_->GetCurrentEntryId() != rankings->Data()->dirty || !entry) {
+ if (!entry) {
// We cannot trust this entry, but we cannot initiate a cleanup from this
// point (we may be in the middle of a cleanup already). Just get rid of
// the invalid pointer and continue; the entry will be deleted when detected