summaryrefslogtreecommitdiffstats
path: root/net/disk_cache/entry_impl.cc
diff options
context:
space:
mode:
authorrvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-28 00:35:25 +0000
committerrvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-28 00:35:25 +0000
commit5c0767d1facaf222cd17956fdf40618173f46a0e (patch)
tree0a2d3c5895d40e65a12f71545cc640959a6c91fb /net/disk_cache/entry_impl.cc
parentad3d2542c02e8a3dba898d5bcf434d301b0862cf (diff)
downloadchromium_src-5c0767d1facaf222cd17956fdf40618173f46a0e.zip
chromium_src-5c0767d1facaf222cd17956fdf40618173f46a0e.tar.gz
chromium_src-5c0767d1facaf222cd17956fdf40618173f46a0e.tar.bz2
Disk Cache: Delete chained block files when they become empty.
We were leaving empty block files in the chain, and worst of all, not reusing them because we were thinking that these files were "almost full". Now we also check for empty files when the cache starts. BUG=16740 TEST=unittest. Review URL: http://codereview.chromium.org/159451 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21762 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/disk_cache/entry_impl.cc')
-rw-r--r--net/disk_cache/entry_impl.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/net/disk_cache/entry_impl.cc b/net/disk_cache/entry_impl.cc
index 75fb92e5..334eb76 100644
--- a/net/disk_cache/entry_impl.cc
+++ b/net/disk_cache/entry_impl.cc
@@ -616,11 +616,11 @@ void EntryImpl::DeleteData(Addr address, int index) {
if (files_[index])
files_[index] = NULL; // Releases the object.
- if (!DeleteCacheFile(backend_->GetFileName(address))) {
- CACHE_UMA(COUNTS, "DeleteFailed", 0, 1);
+ int failure = DeleteCacheFile(backend_->GetFileName(address)) ? 0 : 1;
+ CACHE_UMA(COUNTS, "DeleteFailed", 0, failure);
+ if (failure)
LOG(ERROR) << "Failed to delete " << backend_->GetFileName(address) <<
" from the cache.";
- }
} else {
backend_->DeleteBlock(address, true);
}