| 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..4c0d3af88bbd4caf7c698525b740f7ef1aafa21d 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);
|
| +
|
| + base::Time now = base::Time::Now();
|
| +
|
| + QuotaDatabase::OriginInfoTableEntry entry;
|
| + if (is_eviction && database->GetOriginInfo(origin, type, &entry)) {
|
| + 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,
|
|
|