diff options
author | rvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-22 23:14:23 +0000 |
---|---|---|
committer | rvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-22 23:14:23 +0000 |
commit | b36a7bdca1c1ebc66e9b401296c90d1f69ae686c (patch) | |
tree | 8af2fd3186046226bf24c262a563f9605c3553f3 /net/disk_cache/eviction.cc | |
parent | 2c90e027622a681968bba29fba329c982333d791 (diff) | |
download | chromium_src-b36a7bdca1c1ebc66e9b401296c90d1f69ae686c.zip chromium_src-b36a7bdca1c1ebc66e9b401296c90d1f69ae686c.tar.gz chromium_src-b36a7bdca1c1ebc66e9b401296c90d1f69ae686c.tar.bz2 |
Disk cache: Use TimeTicks instead of Time for some of the
cache histograms.
BUG=14193
TEST=none
Review URL: http://codereview.chromium.org/650068
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@39654 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/disk_cache/eviction.cc')
-rw-r--r-- | net/disk_cache/eviction.cc | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/net/disk_cache/eviction.cc b/net/disk_cache/eviction.cc index fd5bd2e..0d92935 100644 --- a/net/disk_cache/eviction.cc +++ b/net/disk_cache/eviction.cc @@ -38,6 +38,7 @@ #include "net/disk_cache/trace.h" using base::Time; +using base::TimeTicks; namespace { @@ -83,7 +84,7 @@ void Eviction::TrimCache(bool empty) { Trace("*** Trim Cache ***"); trimming_ = true; - Time start = Time::Now(); + TimeTicks start = TimeTicks::Now(); Rankings::ScopedRankingsBlock node(rankings_); Rankings::ScopedRankingsBlock next(rankings_, rankings_->GetPrev(node.get(), Rankings::NO_USE)); @@ -104,7 +105,7 @@ void Eviction::TrimCache(bool empty) { if (!empty) { backend_->OnEvent(Stats::TRIM_ENTRY); - if ((Time::Now() - start).InMilliseconds() > 20) { + if ((TimeTicks::Now() - start).InMilliseconds() > 20) { MessageLoop::current()->PostTask(FROM_HERE, factory_.NewRunnableMethod(&Eviction::TrimCache, false)); break; @@ -245,7 +246,7 @@ bool Eviction::EvictEntry(CacheRankingsBlock* node, bool empty) { void Eviction::TrimCacheV2(bool empty) { Trace("*** Trim Cache ***"); trimming_ = true; - Time start = Time::Now(); + TimeTicks start = TimeTicks::Now(); const int kListsToSearch = 3; Rankings::ScopedRankingsBlock next[kListsToSearch]; @@ -296,7 +297,7 @@ void Eviction::TrimCacheV2(bool empty) { if (!EvictEntry(node.get(), empty)) continue; - if (!empty && (Time::Now() - start).InMilliseconds() > 20) { + if (!empty && (TimeTicks::Now() - start).InMilliseconds() > 20) { MessageLoop::current()->PostTask(FROM_HERE, factory_.NewRunnableMethod(&Eviction::TrimCache, false)); break; @@ -415,7 +416,7 @@ void Eviction::TrimDeleted(bool empty) { if (backend_->disabled_) return; - Time start = Time::Now(); + TimeTicks start = TimeTicks::Now(); Rankings::ScopedRankingsBlock node(rankings_); Rankings::ScopedRankingsBlock next(rankings_, rankings_->GetPrev(node.get(), Rankings::DELETED)); |