| Index: webkit/quota/quota_temporary_storage_evictor.h
|
| diff --git a/webkit/quota/quota_temporary_storage_evictor.h b/webkit/quota/quota_temporary_storage_evictor.h
|
| index 8db1eda88009efbf3640bd3cfd9ed44ce63ff488..785b7d4f9e4a140ba720be4f9a8bec31316c4637 100644
|
| --- a/webkit/quota/quota_temporary_storage_evictor.h
|
| +++ b/webkit/quota/quota_temporary_storage_evictor.h
|
| @@ -40,13 +40,51 @@ class QuotaTemporaryStorageEvictor : public base::NonThreadSafe {
|
| int64 num_skipped_eviction_rounds;
|
| };
|
|
|
| + struct EvictionRoundStatistics {
|
| + EvictionRoundStatistics()
|
| + : started(false),
|
| + amount_of_usage_overage(-1),
|
| + amount_of_diskspace_shortage(-1),
|
| + usage_on_beginning_of_round(-1),
|
| + usage_on_end_of_round(-1),
|
| + num_evicted_origins(0) {
|
| + }
|
| +
|
| + void put_usage_overage(int64 overage) {
|
| + if (amount_of_usage_overage < 0)
|
| + amount_of_usage_overage = overage;
|
| + }
|
| +
|
| + void put_diskspace_shortage(int64 diskspace_shortage) {
|
| + if (amount_of_diskspace_shortage < 0)
|
| + amount_of_diskspace_shortage = diskspace_shortage;
|
| + }
|
| +
|
| + void put_usage(int64 usage) {
|
| + if (usage_on_beginning_of_round < 0)
|
| + usage_on_beginning_of_round = usage;
|
| + usage_on_end_of_round = usage;
|
| + }
|
| +
|
| + bool started;
|
| +
|
| + base::Time start_time;
|
| + int64 amount_of_usage_overage;
|
| + int64 amount_of_diskspace_shortage;
|
| +
|
| + int64 usage_on_beginning_of_round;
|
| + int64 usage_on_end_of_round;
|
| + int64 num_evicted_origins;
|
| + };
|
| +
|
| QuotaTemporaryStorageEvictor(
|
| QuotaEvictionHandler* quota_eviction_handler,
|
| int64 interval_ms);
|
| virtual ~QuotaTemporaryStorageEvictor();
|
|
|
| void GetStatistics(std::map<std::string, int64>* statistics);
|
| - void ReportHistogram();
|
| + void ReportPerRoundHistogram();
|
| + void ReportPerHourHistogram();
|
| void Start();
|
|
|
| private:
|
| @@ -63,6 +101,9 @@ class QuotaTemporaryStorageEvictor : public base::NonThreadSafe {
|
| void OnGotLRUOrigin(const GURL& origin);
|
| void OnEvictionComplete(QuotaStatusCode status);
|
|
|
| + void OnEvictionRoundStarted();
|
| + void OnEvictionRoundFinished();
|
| +
|
| // This is only used for tests.
|
| void set_repeated_eviction(bool repeated_eviction) {
|
| repeated_eviction_ = repeated_eviction;
|
| @@ -79,14 +120,12 @@ class QuotaTemporaryStorageEvictor : public base::NonThreadSafe {
|
| QuotaEvictionHandler* quota_eviction_handler_;
|
|
|
| Statistics statistics_;
|
| + EvictionRoundStatistics round_statistics_;
|
| + base::Time time_of_last_nonskipped_round_;
|
| + base::Time time_of_end_of_last_round_;
|
|
|
| int64 interval_ms_;
|
| bool repeated_eviction_;
|
| - int num_evicted_origins_in_round_;
|
| -
|
| - int64 usage_on_beginning_of_round_;
|
| - base::Time time_of_beginning_of_round_;
|
| - base::Time time_of_end_of_last_round_;
|
|
|
| base::OneShotTimer<QuotaTemporaryStorageEvictor> eviction_timer_;
|
| base::RepeatingTimer<QuotaTemporaryStorageEvictor> histogram_timer_;
|
|
|