summaryrefslogtreecommitdiffstats
path: root/net/disk_cache/eviction.cc
diff options
context:
space:
mode:
authorrvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-25 23:44:20 +0000
committerrvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-25 23:44:20 +0000
commit6192f73a9dd17c950ef1ca97db086e8bc4eaf05e (patch)
tree7af372f9670e74b144d17f1f7c009a9eb13a74a2 /net/disk_cache/eviction.cc
parent1ba590018ad58ea18ec3079f089feb64fd951d87 (diff)
downloadchromium_src-6192f73a9dd17c950ef1ca97db086e8bc4eaf05e.zip
chromium_src-6192f73a9dd17c950ef1ca97db086e8bc4eaf05e.tar.gz
chromium_src-6192f73a9dd17c950ef1ca97db086e8bc4eaf05e.tar.bz2
Disk cache: First pass to make it possible to have
multiple instances of BackendImpl. We need multiple objects to be able to support media files on the cache. After this change, histograms will be the only thing that get messed up by multiple disk caches. Review URL: http://codereview.chromium.org/49027 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@12520 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/disk_cache/eviction.cc')
-rw-r--r--net/disk_cache/eviction.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/net/disk_cache/eviction.cc b/net/disk_cache/eviction.cc
index 3706260..76af8db 100644
--- a/net/disk_cache/eviction.cc
+++ b/net/disk_cache/eviction.cc
@@ -67,6 +67,7 @@ void Eviction::Init(BackendImpl* backend) {
header_ = &backend_->data_->header;
max_size_ = LowWaterAdjust(backend_->max_size_);
new_eviction_ = backend->new_eviction_;
+ first_trim_ = true;
}
void Eviction::TrimCache(bool empty) {
@@ -141,9 +142,8 @@ void Eviction::OnDestroyEntry(EntryImpl* entry) {
}
void Eviction::ReportTrimTimes(EntryImpl* entry) {
- static bool first_time = true;
- if (first_time) {
- first_time = false;
+ if (first_trim_) {
+ first_trim_ = false;
if (backend_->ShouldReportAgain()) {
std::string name(StringPrintf("DiskCache.TrimAge_%d",
header_->experiment));