OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "webkit/quota/quota_temporary_storage_evictor.h" | 5 #include "webkit/quota/quota_temporary_storage_evictor.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 } | 45 } |
46 | 46 |
47 QuotaTemporaryStorageEvictor::QuotaTemporaryStorageEvictor( | 47 QuotaTemporaryStorageEvictor::QuotaTemporaryStorageEvictor( |
48 QuotaEvictionHandler* quota_eviction_handler, | 48 QuotaEvictionHandler* quota_eviction_handler, |
49 int64 interval_ms) | 49 int64 interval_ms) |
50 : min_available_disk_space_to_start_eviction_( | 50 : min_available_disk_space_to_start_eviction_( |
51 kMinAvailableDiskSpaceToStartEvictionNotSpecified), | 51 kMinAvailableDiskSpaceToStartEvictionNotSpecified), |
52 quota_eviction_handler_(quota_eviction_handler), | 52 quota_eviction_handler_(quota_eviction_handler), |
53 interval_ms_(interval_ms), | 53 interval_ms_(interval_ms), |
54 repeated_eviction_(true), | 54 repeated_eviction_(true), |
55 weak_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)) { | 55 weak_factory_(this) { |
56 DCHECK(quota_eviction_handler); | 56 DCHECK(quota_eviction_handler); |
57 } | 57 } |
58 | 58 |
59 QuotaTemporaryStorageEvictor::~QuotaTemporaryStorageEvictor() { | 59 QuotaTemporaryStorageEvictor::~QuotaTemporaryStorageEvictor() { |
60 } | 60 } |
61 | 61 |
62 void QuotaTemporaryStorageEvictor::GetStatistics( | 62 void QuotaTemporaryStorageEvictor::GetStatistics( |
63 std::map<std::string, int64>* statistics) { | 63 std::map<std::string, int64>* statistics) { |
64 DCHECK(statistics); | 64 DCHECK(statistics); |
65 | 65 |
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
254 ++statistics_.num_errors_on_evicting_origin; | 254 ++statistics_.num_errors_on_evicting_origin; |
255 if (repeated_eviction_) { | 255 if (repeated_eviction_) { |
256 // Sleep for a while and retry again until we see too many errors. | 256 // Sleep for a while and retry again until we see too many errors. |
257 StartEvictionTimerWithDelay(interval_ms_); | 257 StartEvictionTimerWithDelay(interval_ms_); |
258 } | 258 } |
259 OnEvictionRoundFinished(); | 259 OnEvictionRoundFinished(); |
260 } | 260 } |
261 } | 261 } |
262 | 262 |
263 } // namespace quota | 263 } // namespace quota |
OLD | NEW |