| 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 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 PrefReadError ReadPrefs() override; | 99 PrefReadError ReadPrefs() override; |
| 100 void ReadPrefsAsync(ReadErrorDelegate* error_delegate) override; | 100 void ReadPrefsAsync(ReadErrorDelegate* error_delegate) override; |
| 101 void CommitPendingWrite() override; | 101 void CommitPendingWrite() override; |
| 102 void SchedulePendingLossyWrites() override; | 102 void SchedulePendingLossyWrites() override; |
| 103 void ReportValueChanged(const std::string& key, uint32_t flags) override; | 103 void ReportValueChanged(const std::string& key, uint32_t flags) override; |
| 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_reply| to be called once, on the next |
| 110 // successful write event of |writer_|. | 110 // successful write event of |writer_|. |
| 111 void RegisterOnNextSuccessfulWriteCallback( | 111 void RegisterOnNextSuccessfulWriteReply( |
| 112 const base::Closure& on_next_successful_write); | 112 const base::Closure& on_next_successful_write_reply); |
| 113 | 113 |
| 114 void ClearMutableValues() override; | 114 void ClearMutableValues() override; |
| 115 | 115 |
| 116 private: | 116 private: |
| 117 // Represents a histogram for recording the number of writes to the pref file | 117 // Represents a histogram for recording the number of writes to the pref file |
| 118 // that occur every kHistogramWriteReportIntervalInMins minutes. | 118 // that occur every kHistogramWriteReportIntervalInMins minutes. |
| 119 class COMPONENTS_PREFS_EXPORT WriteCountHistogram { | 119 class COMPONENTS_PREFS_EXPORT WriteCountHistogram { |
| 120 public: | 120 public: |
| 121 static const int32_t kHistogramWriteReportIntervalMins; | 121 static const int32_t kHistogramWriteReportIntervalMins; |
| 122 | 122 |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 222 PrefReadError read_error_; | 222 PrefReadError read_error_; |
| 223 | 223 |
| 224 std::set<std::string> keys_need_empty_value_; | 224 std::set<std::string> keys_need_empty_value_; |
| 225 | 225 |
| 226 WriteCountHistogram write_count_histogram_; | 226 WriteCountHistogram write_count_histogram_; |
| 227 | 227 |
| 228 DISALLOW_COPY_AND_ASSIGN(JsonPrefStore); | 228 DISALLOW_COPY_AND_ASSIGN(JsonPrefStore); |
| 229 }; | 229 }; |
| 230 | 230 |
| 231 #endif // COMPONENTS_PREFS_JSON_PREF_STORE_H_ | 231 #endif // COMPONENTS_PREFS_JSON_PREF_STORE_H_ |
| OLD | NEW |