Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(61)

Side by Side Diff: storage/browser/quota/quota_temporary_storage_evictor.h

Issue 1782053004: Change how the quota system computes the total poolsize for temporary storage (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: poolSize Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 #ifndef STORAGE_BROWSER_QUOTA_QUOTA_TEMPORARY_STORAGE_EVICTOR_H_ 5 #ifndef STORAGE_BROWSER_QUOTA_QUOTA_TEMPORARY_STORAGE_EVICTOR_H_
6 #define STORAGE_BROWSER_QUOTA_QUOTA_TEMPORARY_STORAGE_EVICTOR_H_ 6 #define STORAGE_BROWSER_QUOTA_QUOTA_TEMPORARY_STORAGE_EVICTOR_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <map> 10 #include <map>
11 #include <set> 11 #include <set>
12 #include <string> 12 #include <string>
13 13
14 #include "base/macros.h" 14 #include "base/macros.h"
15 #include "base/memory/weak_ptr.h" 15 #include "base/memory/weak_ptr.h"
16 #include "base/threading/non_thread_safe.h" 16 #include "base/threading/non_thread_safe.h"
17 #include "base/timer/timer.h" 17 #include "base/timer/timer.h"
18 #include "storage/browser/storage_browser_export.h" 18 #include "storage/browser/storage_browser_export.h"
19 #include "storage/common/quota/quota_types.h" 19 #include "storage/common/quota/quota_types.h"
20 20
21 class GURL; 21 class GURL;
22 22
23 namespace content { 23 namespace content {
24 class QuotaTemporaryStorageEvictorTest; 24 class QuotaTemporaryStorageEvictorTest;
25 } 25 }
26 26
27 namespace storage { 27 namespace storage {
28 28
29 class QuotaEvictionHandler; 29 class QuotaEvictionHandler;
30 struct UsageAndQuota; 30 struct XUsageAndQuota;
31 31
32 class STORAGE_EXPORT QuotaTemporaryStorageEvictor : public base::NonThreadSafe { 32 class STORAGE_EXPORT QuotaTemporaryStorageEvictor : public base::NonThreadSafe {
33 public: 33 public:
34 struct Statistics { 34 struct Statistics {
35 Statistics() 35 Statistics()
36 : num_errors_on_evicting_origin(0), 36 : num_errors_on_evicting_origin(0),
37 num_errors_on_getting_usage_and_quota(0), 37 num_errors_on_getting_usage_and_quota(0),
38 num_evicted_origins(0), 38 num_evicted_origins(0),
39 num_eviction_rounds(0), 39 num_eviction_rounds(0),
40 num_skipped_eviction_rounds(0) {} 40 num_skipped_eviction_rounds(0) {}
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 friend class content::QuotaTemporaryStorageEvictorTest; 90 friend class content::QuotaTemporaryStorageEvictorTest;
91 91
92 void StartEvictionTimerWithDelay(int delay_ms); 92 void StartEvictionTimerWithDelay(int delay_ms);
93 void ConsiderEviction(); 93 void ConsiderEviction();
94 void OnGotVolumeInfo(bool success, 94 void OnGotVolumeInfo(bool success,
95 uint64_t available_space, 95 uint64_t available_space,
96 uint64_t total_size); 96 uint64_t total_size);
97 void OnGotUsageAndQuotaForEviction( 97 void OnGotUsageAndQuotaForEviction(
98 int64_t must_remain_available_space, 98 int64_t must_remain_available_space,
99 QuotaStatusCode status, 99 QuotaStatusCode status,
100 const UsageAndQuota& quota_and_usage); 100 const XUsageAndQuota& quota_and_usage);
101 void OnGotEvictionOrigin(const GURL& origin); 101 void OnGotEvictionOrigin(const GURL& origin);
102 void OnEvictionComplete(QuotaStatusCode status); 102 void OnEvictionComplete(QuotaStatusCode status);
103 103
104 void OnEvictionRoundStarted(); 104 void OnEvictionRoundStarted();
105 void OnEvictionRoundFinished(); 105 void OnEvictionRoundFinished();
106 106
107 // This is only used for tests. 107 // This is only used for tests.
108 void set_repeated_eviction(bool repeated_eviction) { 108 void set_repeated_eviction(bool repeated_eviction) {
109 repeated_eviction_ = repeated_eviction; 109 repeated_eviction_ = repeated_eviction;
110 } 110 }
(...skipping 18 matching lines...) Expand all
129 base::OneShotTimer eviction_timer_; 129 base::OneShotTimer eviction_timer_;
130 base::RepeatingTimer histogram_timer_; 130 base::RepeatingTimer histogram_timer_;
131 base::WeakPtrFactory<QuotaTemporaryStorageEvictor> weak_factory_; 131 base::WeakPtrFactory<QuotaTemporaryStorageEvictor> weak_factory_;
132 132
133 DISALLOW_COPY_AND_ASSIGN(QuotaTemporaryStorageEvictor); 133 DISALLOW_COPY_AND_ASSIGN(QuotaTemporaryStorageEvictor);
134 }; 134 };
135 135
136 } // namespace storage 136 } // namespace storage
137 137
138 #endif // STORAGE_BROWSER_QUOTA_QUOTA_TEMPORARY_STORAGE_EVICTOR_H_ 138 #endif // STORAGE_BROWSER_QUOTA_QUOTA_TEMPORARY_STORAGE_EVICTOR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698