OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 COMPONENTS_PREFS_JSON_PREF_STORE_H_ | 5 #ifndef COMPONENTS_PREFS_JSON_PREF_STORE_H_ |
6 #define COMPONENTS_PREFS_JSON_PREF_STORE_H_ | 6 #define COMPONENTS_PREFS_JSON_PREF_STORE_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
104 | 104 |
105 // Just like RemoveValue(), but doesn't notify observers. Used when doing some | 105 // Just like RemoveValue(), but doesn't notify observers. Used when doing some |
106 // cleanup that shouldn't otherwise alert observers. | 106 // cleanup that shouldn't otherwise alert observers. |
107 void RemoveValueSilently(const std::string& key, uint32_t flags); | 107 void RemoveValueSilently(const std::string& key, uint32_t flags); |
108 | 108 |
109 // Registers |on_next_successful_write| to be called once, on the next | 109 // Registers |on_next_successful_write| to be called once, on the next |
110 // successful write event of |writer_|. | 110 // successful write event of |writer_|. |
111 void RegisterOnNextSuccessfulWriteCallback( | 111 void RegisterOnNextSuccessfulWriteCallback( |
112 const base::Closure& on_next_successful_write); | 112 const base::Closure& on_next_successful_write); |
113 | 113 |
114 // Registers |on_next_successful_write| to be called once, on the next | |
115 // successful write event of |writer| and on the blocking pool. | |
116 void RegisterOnNextSuccessfulWriteBlockingCallback( | |
117 const base::Closure& on_next_successful_write); | |
gab
2016/08/03 18:19:34
Adapt API to match changes to ImportantFileWriter'
proberge
2016/08/04 00:13:45
Done.
| |
118 | |
114 void ClearMutableValues() override; | 119 void ClearMutableValues() override; |
115 | 120 |
116 private: | 121 private: |
117 // Represents a histogram for recording the number of writes to the pref file | 122 // Represents a histogram for recording the number of writes to the pref file |
118 // that occur every kHistogramWriteReportIntervalInMins minutes. | 123 // that occur every kHistogramWriteReportIntervalInMins minutes. |
119 class COMPONENTS_PREFS_EXPORT WriteCountHistogram { | 124 class COMPONENTS_PREFS_EXPORT WriteCountHistogram { |
120 public: | 125 public: |
121 static const int32_t kHistogramWriteReportIntervalMins; | 126 static const int32_t kHistogramWriteReportIntervalMins; |
122 | 127 |
123 WriteCountHistogram(const base::TimeDelta& commit_interval, | 128 WriteCountHistogram(const base::TimeDelta& commit_interval, |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
222 PrefReadError read_error_; | 227 PrefReadError read_error_; |
223 | 228 |
224 std::set<std::string> keys_need_empty_value_; | 229 std::set<std::string> keys_need_empty_value_; |
225 | 230 |
226 WriteCountHistogram write_count_histogram_; | 231 WriteCountHistogram write_count_histogram_; |
227 | 232 |
228 DISALLOW_COPY_AND_ASSIGN(JsonPrefStore); | 233 DISALLOW_COPY_AND_ASSIGN(JsonPrefStore); |
229 }; | 234 }; |
230 | 235 |
231 #endif // COMPONENTS_PREFS_JSON_PREF_STORE_H_ | 236 #endif // COMPONENTS_PREFS_JSON_PREF_STORE_H_ |
OLD | NEW |