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-03-18 18:54:52 +0000
committerrvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-18 18:54:52 +0000
commit1849d01a855914348bbdc07c7674764daf549358 (patch)
tree432d2a804daa8424703d394dc3a89e662b1e3aa4 /net/disk_cache/entry_impl.cc
parentd6a612019430c62642db846393dbab1e9d4c7869 (diff)
downloadchromium_src-1849d01a855914348bbdc07c7674764daf549358.zip
chromium_src-1849d01a855914348bbdc07c7674764daf549358.tar.gz
chromium_src-1849d01a855914348bbdc07c7674764daf549358.tar.bz2
Disk cache: First implementation of TrimDeleted() and a few
other fixes related to the new eviction code. As before, almost everything is disabled by default. Review URL: http://codereview.chromium.org/48112 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@11995 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/disk_cache/entry_impl.cc')
-rw-r--r--net/disk_cache/entry_impl.cc14
1 files changed, 10 insertions, 4 deletions
diff --git a/net/disk_cache/entry_impl.cc b/net/disk_cache/entry_impl.cc
index 446138e..2e852a4 100644
--- a/net/disk_cache/entry_impl.cc
+++ b/net/disk_cache/entry_impl.cc
@@ -382,7 +382,7 @@ base::PlatformFile EntryImpl::GetPlatformFile(int index) {
return base::CreatePlatformFile(backend_->GetFileName(address),
base::PLATFORM_FILE_OPEN |
base::PLATFORM_FILE_READ |
- base::PLATFORM_FILE_ASYNC,
+ base::PLATFORM_FILE_ASYNC,
NULL);
}
@@ -457,19 +457,25 @@ void EntryImpl::InternalDoom() {
void EntryImpl::DeleteEntryData(bool everything) {
DCHECK(doomed_ || !everything);
- UMA_HISTOGRAM_COUNTS("DiskCache.DeleteHeader", GetDataSize(0));
- UMA_HISTOGRAM_COUNTS("DiskCache.DeleteData", GetDataSize(1));
+ if (GetDataSize(0))
+ UMA_HISTOGRAM_COUNTS("DiskCache.DeleteHeader", GetDataSize(0));
+ if (GetDataSize(1))
+ UMA_HISTOGRAM_COUNTS("DiskCache.DeleteData", GetDataSize(1));
for (int index = 0; index < NUM_STREAMS; index++) {
Addr address(entry_.Data()->data_addr[index]);
if (address.is_initialized()) {
DeleteData(address, index);
backend_->ModifyStorageSize(entry_.Data()->data_size[index] -
unreported_size_[index], 0);
+ entry_.Data()->data_addr[index] = 0;
+ entry_.Data()->data_size[index] = 0;
}
}
- if (!everything)
+ if (!everything) {
+ entry_.Store();
return;
+ }
// Remove all traces of this entry.
backend_->RemoveEntry(this);