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>2010-09-29 21:00:35 +0000
committerrvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-29 21:00:35 +0000
commit10f2e69cb7cd2c4dc8f3c2dbd7efdd1fa7c15a86 (patch)
treed064fe7d1e5cd4a966f5ea3a466f0dee01466273 /net/disk_cache/entry_impl.cc
parent023cee77677908dda1466d6c88e9dc1c7dddc705 (diff)
downloadchromium_src-10f2e69cb7cd2c4dc8f3c2dbd7efdd1fa7c15a86.zip
chromium_src-10f2e69cb7cd2c4dc8f3c2dbd7efdd1fa7c15a86.tar.gz
chromium_src-10f2e69cb7cd2c4dc8f3c2dbd7efdd1fa7c15a86.tar.bz2
Disk cache: Change the way we delete files.
Now we always share delete and request delete access when we open the files, and don't close the handle before deleting a file. The result is that the delete operation should not be prevented by someone opening the file right after we close our handle. The downside is that anybody attempting to open one of our files while the browser is running will have to also share delete or their request will fail. On the other hand, we don't really want other people modifying the files at the same time, so the change may be for good. The caveat is that I think most of the failures are result of improper AV behavior, so we have to see what happens. BUG=16723 TEST=net_unittests Review URL: http://codereview.chromium.org/3475025 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@60989 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/disk_cache/entry_impl.cc')
-rw-r--r--net/disk_cache/entry_impl.cc10
1 files changed, 5 insertions, 5 deletions
diff --git a/net/disk_cache/entry_impl.cc b/net/disk_cache/entry_impl.cc
index c8ee9b0..0655b28 100644
--- a/net/disk_cache/entry_impl.cc
+++ b/net/disk_cache/entry_impl.cc
@@ -945,14 +945,14 @@ void EntryImpl::DeleteData(Addr address, int index) {
if (!address.is_initialized())
return;
if (address.is_separate_file()) {
- if (files_[index])
- files_[index] = NULL; // Releases the object.
-
- int failure = DeleteCacheFile(backend_->GetFileName(address)) ? 0 : 1;
+ int failure = !DeleteCacheFile(backend_->GetFileName(address));
CACHE_UMA(COUNTS, "DeleteFailed", 0, failure);
- if (failure)
+ if (failure) {
LOG(ERROR) << "Failed to delete " <<
backend_->GetFileName(address).value() << " from the cache.";
+ }
+ if (files_[index])
+ files_[index] = NULL; // Releases the object.
} else {
backend_->DeleteBlock(address, true);
}