diff options
author | rvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-25 23:52:02 +0000 |
---|---|---|
committer | rvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-25 23:52:02 +0000 |
commit | ceb61da3987d8b7ed828c88daac779b1fbc8c6f9 (patch) | |
tree | bcbf1cdf1a3288ab7f1540bfa66f6d7742b6b154 /net/disk_cache/entry_impl.cc | |
parent | 472ce96a4b839814ed93c26d35d07c78de019b17 (diff) | |
download | chromium_src-ceb61da3987d8b7ed828c88daac779b1fbc8c6f9.zip chromium_src-ceb61da3987d8b7ed828c88daac779b1fbc8c6f9.tar.gz chromium_src-ceb61da3987d8b7ed828c88daac779b1fbc8c6f9.tar.bz2 |
Disk cache: Prevent obscure file corruption and deal
with the result of that corruption.
1. Now we mark any open entry as dirty, even if we are
supposed to delete the entry right away because if we
crash before that, we may end up clearing the dirty
flag of a dirty entry.
2. When we look for a parent of a given entry we now
double check that the entry is the one that we want (and
not just another entry with the same key).
3. If we have a loop on the hash collision list (result of
failing to do 1 and 2 above), we figure that out.
4. Now every time we open an entry from an LRU list we end
up using the same code path (with the proper handling of
dirty entries).
BUG=69135
TEST=net_unittests
Review URL: http://codereview.chromium.org/6292011
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@72563 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/disk_cache/entry_impl.cc')
-rw-r--r-- | net/disk_cache/entry_impl.cc | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/net/disk_cache/entry_impl.cc b/net/disk_cache/entry_impl.cc index ff05e11..57d4d83 100644 --- a/net/disk_cache/entry_impl.cc +++ b/net/disk_cache/entry_impl.cc @@ -589,6 +589,7 @@ CacheAddr EntryImpl::GetNextAddress() { } void EntryImpl::SetNextAddress(Addr address) { + DCHECK_NE(address.value(), entry_.address().value()); entry_.Data()->next = address.value(); bool success = entry_.Store(); DCHECK(success); |