| 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 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 | 111 |
| 112 // Registers |on_next_successful_write_reply| to be called once, on the next | 112 // Registers |on_next_successful_write_reply| to be called once, on the next |
| 113 // successful write event of |writer_|. | 113 // successful write event of |writer_|. |
| 114 // |on_next_successful_write_reply| will be called on the thread from which | 114 // |on_next_successful_write_reply| will be called on the thread from which |
| 115 // this method is called and does not need to be thread safe. | 115 // this method is called and does not need to be thread safe. |
| 116 void RegisterOnNextSuccessfulWriteReply( | 116 void RegisterOnNextSuccessfulWriteReply( |
| 117 const base::Closure& on_next_successful_write_reply); | 117 const base::Closure& on_next_successful_write_reply); |
| 118 | 118 |
| 119 void ClearMutableValues() override; | 119 void ClearMutableValues() override; |
| 120 | 120 |
| 121 void OnStoreDeletionFromDisk() override; |
| 122 |
| 121 private: | 123 private: |
| 122 // Represents a histogram for recording the number of writes to the pref file | 124 // Represents a histogram for recording the number of writes to the pref file |
| 123 // that occur every kHistogramWriteReportIntervalInMins minutes. | 125 // that occur every kHistogramWriteReportIntervalInMins minutes. |
| 124 class COMPONENTS_PREFS_EXPORT WriteCountHistogram { | 126 class COMPONENTS_PREFS_EXPORT WriteCountHistogram { |
| 125 public: | 127 public: |
| 126 static const int32_t kHistogramWriteReportIntervalMins; | 128 static const int32_t kHistogramWriteReportIntervalMins; |
| 127 | 129 |
| 128 WriteCountHistogram(const base::TimeDelta& commit_interval, | 130 WriteCountHistogram(const base::TimeDelta& commit_interval, |
| 129 const base::FilePath& path); | 131 const base::FilePath& path); |
| 130 // Constructor for testing. |clock| is a test Clock that is used to retrieve | 132 // Constructor for testing. |clock| is a test Clock that is used to retrieve |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 251 base::Closure on_next_successful_write_reply_; | 253 base::Closure on_next_successful_write_reply_; |
| 252 | 254 |
| 253 WriteCountHistogram write_count_histogram_; | 255 WriteCountHistogram write_count_histogram_; |
| 254 | 256 |
| 255 SEQUENCE_CHECKER(sequence_checker_); | 257 SEQUENCE_CHECKER(sequence_checker_); |
| 256 | 258 |
| 257 DISALLOW_COPY_AND_ASSIGN(JsonPrefStore); | 259 DISALLOW_COPY_AND_ASSIGN(JsonPrefStore); |
| 258 }; | 260 }; |
| 259 | 261 |
| 260 #endif // COMPONENTS_PREFS_JSON_PREF_STORE_H_ | 262 #endif // COMPONENTS_PREFS_JSON_PREF_STORE_H_ |
| OLD | NEW |