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/eviction.h | |
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/eviction.h')
-rw-r--r-- | net/disk_cache/eviction.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/net/disk_cache/eviction.h b/net/disk_cache/eviction.h index 0f5eeb7..26f88fe 100644 --- a/net/disk_cache/eviction.h +++ b/net/disk_cache/eviction.h @@ -40,6 +40,10 @@ class Eviction { void OnDoomEntry(EntryImpl* entry); void OnDestroyEntry(EntryImpl* entry); + // Testing interface. + void SetTestMode(); + void TrimDeletedList(bool empty); + private: void PostDelayedTrim(); void DelayedTrim(); @@ -75,6 +79,7 @@ class Eviction { bool trimming_; bool delay_trim_; bool init_; + bool test_mode_; bool in_experiment_; ScopedRunnableMethodFactory<Eviction> factory_; |