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

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

Issue 2908223002: Deprecate NonThreadSafe in storage/browser/quota in favor of SequenceChecker. (Closed)
Patch Set: Created 3 years, 6 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/sequence_checker.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 QuotaSettings; 30 struct QuotaSettings;
31 31
32 class STORAGE_EXPORT QuotaTemporaryStorageEvictor : public base::NonThreadSafe { 32 class STORAGE_EXPORT QuotaTemporaryStorageEvictor {
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) {}
41 int64_t num_errors_on_evicting_origin; 41 int64_t num_errors_on_evicting_origin;
42 int64_t num_errors_on_getting_usage_and_quota; 42 int64_t num_errors_on_getting_usage_and_quota;
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 EvictionRoundStatistics round_statistics_; 103 EvictionRoundStatistics round_statistics_;
104 base::Time time_of_end_of_last_nonskipped_round_; 104 base::Time time_of_end_of_last_nonskipped_round_;
105 base::Time time_of_end_of_last_round_; 105 base::Time time_of_end_of_last_round_;
106 std::set<GURL> in_progress_eviction_origins_; 106 std::set<GURL> in_progress_eviction_origins_;
107 107
108 int64_t interval_ms_; 108 int64_t interval_ms_;
109 bool timer_disabled_for_testing_; 109 bool timer_disabled_for_testing_;
110 110
111 base::OneShotTimer eviction_timer_; 111 base::OneShotTimer eviction_timer_;
112 base::RepeatingTimer histogram_timer_; 112 base::RepeatingTimer histogram_timer_;
113
114 SEQUENCE_CHECKER(sequence_checker_);
115
113 base::WeakPtrFactory<QuotaTemporaryStorageEvictor> weak_factory_; 116 base::WeakPtrFactory<QuotaTemporaryStorageEvictor> weak_factory_;
114 117
115 DISALLOW_COPY_AND_ASSIGN(QuotaTemporaryStorageEvictor); 118 DISALLOW_COPY_AND_ASSIGN(QuotaTemporaryStorageEvictor);
116 }; 119 };
117 120
118 } // namespace storage 121 } // namespace storage
119 122
120 #endif // STORAGE_BROWSER_QUOTA_QUOTA_TEMPORARY_STORAGE_EVICTOR_H_ 123 #endif // STORAGE_BROWSER_QUOTA_QUOTA_TEMPORARY_STORAGE_EVICTOR_H_
OLDNEW
« no previous file with comments | « storage/browser/quota/client_usage_tracker.cc ('k') | storage/browser/quota/quota_temporary_storage_evictor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698