Chromium Code Reviews| Index: storage/browser/quota/quota_manager.cc |
| diff --git a/storage/browser/quota/quota_manager.cc b/storage/browser/quota/quota_manager.cc |
| index 0052f2d7ebf4f12662042e91b66a74bec1a82179..6d6872f44259495f1953a63c6cdba6e53bcd5e30 100644 |
| --- a/storage/browser/quota/quota_manager.cc |
| +++ b/storage/browser/quota/quota_manager.cc |
| @@ -76,6 +76,10 @@ const int QuotaManager::kEvictionIntervalInMilliSeconds = |
| const char QuotaManager::kTimeBetweenRepeatedOriginEvictionsHistogram[] = |
| "Quota.TimeBetweenRepeatedOriginEvictions"; |
| +const char QuotaManager::kEvictedOriginAccessedCountHistogram[] = |
| + "Quota.EvictedOriginAccessCount"; |
| +const char QuotaManager::kEvictedOriginTimeSinceAccessHistogram[] = |
| + "Quota.EvictedOriginTimeSinceAccess"; |
| // Heuristics: assuming average cloud server allows a few Gigs storage |
| // on the server side and the storage needs to be shared for user data |
| @@ -159,6 +163,18 @@ bool DeleteOriginInfoOnDBThread(const GURL& origin, |
| bool is_eviction, |
| QuotaDatabase* database) { |
| DCHECK(database); |
| + |
| + QuotaDatabase::OriginInfoTableEntry entry; |
| + |
| + base::Time now = base::Time::Now(); |
|
michaeln
2015/10/30 00:49:02
maybe swap lines |now| and |entry| are declared o
calamity
2015/11/02 06:27:44
Done.
|
| + if (database->GetOriginInfo(origin, type, &entry)) { |
|
michaeln
2015/10/30 00:49:02
please add |is_eviction| to this condition too
calamity
2015/11/02 06:27:44
Done. Nice catch.
|
| + UMA_HISTOGRAM_COUNTS(QuotaManager::kEvictedOriginAccessedCountHistogram, |
| + entry.used_count); |
| + UMA_HISTOGRAM_LONG_TIMES( |
| + QuotaManager::kEvictedOriginTimeSinceAccessHistogram, |
| + now - entry.last_access_time); |
| + } |
| + |
| if (!database->DeleteOriginInfo(origin, type)) |
| return false; |
| @@ -171,7 +187,6 @@ bool DeleteOriginInfoOnDBThread(const GURL& origin, |
| if (!database->GetOriginLastEvictionTime(origin, type, &last_eviction_time)) |
| return false; |
| - base::Time now = base::Time::Now(); |
| if (last_eviction_time != base::Time()) { |
| UMA_HISTOGRAM_LONG_TIMES( |
| QuotaManager::kTimeBetweenRepeatedOriginEvictionsHistogram, |