| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 CHROME_BROWSER_PREFS_TRACKED_SEGREGATED_PREF_STORE_H_ | 5 #ifndef CHROME_BROWSER_PREFS_TRACKED_SEGREGATED_PREF_STORE_H_ |
| 6 #define CHROME_BROWSER_PREFS_TRACKED_SEGREGATED_PREF_STORE_H_ | 6 #define CHROME_BROWSER_PREFS_TRACKED_SEGREGATED_PREF_STORE_H_ |
| 7 | 7 |
| 8 #include <set> | 8 #include <set> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 bool GetMutableValue(const std::string& key, base::Value** result) override; | 61 bool GetMutableValue(const std::string& key, base::Value** result) override; |
| 62 void ReportValueChanged(const std::string& key, uint32 flags) override; | 62 void ReportValueChanged(const std::string& key, uint32 flags) override; |
| 63 void SetValueSilently(const std::string& key, | 63 void SetValueSilently(const std::string& key, |
| 64 base::Value* value, | 64 base::Value* value, |
| 65 uint32 flags) override; | 65 uint32 flags) override; |
| 66 bool ReadOnly() const override; | 66 bool ReadOnly() const override; |
| 67 PrefReadError GetReadError() const override; | 67 PrefReadError GetReadError() const override; |
| 68 PrefReadError ReadPrefs() override; | 68 PrefReadError ReadPrefs() override; |
| 69 void ReadPrefsAsync(ReadErrorDelegate* error_delegate) override; | 69 void ReadPrefsAsync(ReadErrorDelegate* error_delegate) override; |
| 70 void CommitPendingWrite() override; | 70 void CommitPendingWrite() override; |
| 71 void SchedulePendingLossyWrites() override; |
| 71 | 72 |
| 72 private: | 73 private: |
| 73 // Aggregates events from the underlying stores and synthesizes external | 74 // Aggregates events from the underlying stores and synthesizes external |
| 74 // events via |on_initialization|, |read_error_delegate_|, and |observers_|. | 75 // events via |on_initialization|, |read_error_delegate_|, and |observers_|. |
| 75 class AggregatingObserver : public PrefStore::Observer { | 76 class AggregatingObserver : public PrefStore::Observer { |
| 76 public: | 77 public: |
| 77 explicit AggregatingObserver(SegregatedPrefStore* outer); | 78 explicit AggregatingObserver(SegregatedPrefStore* outer); |
| 78 | 79 |
| 79 // PrefStore::Observer implementation | 80 // PrefStore::Observer implementation |
| 80 void OnPrefValueChanged(const std::string& key) override; | 81 void OnPrefValueChanged(const std::string& key) override; |
| (...skipping 19 matching lines...) Expand all Loading... |
| 100 std::set<std::string> selected_preference_names_; | 101 std::set<std::string> selected_preference_names_; |
| 101 | 102 |
| 102 scoped_ptr<PersistentPrefStore::ReadErrorDelegate> read_error_delegate_; | 103 scoped_ptr<PersistentPrefStore::ReadErrorDelegate> read_error_delegate_; |
| 103 ObserverList<PrefStore::Observer, true> observers_; | 104 ObserverList<PrefStore::Observer, true> observers_; |
| 104 AggregatingObserver aggregating_observer_; | 105 AggregatingObserver aggregating_observer_; |
| 105 | 106 |
| 106 DISALLOW_COPY_AND_ASSIGN(SegregatedPrefStore); | 107 DISALLOW_COPY_AND_ASSIGN(SegregatedPrefStore); |
| 107 }; | 108 }; |
| 108 | 109 |
| 109 #endif // CHROME_BROWSER_PREFS_TRACKED_SEGREGATED_PREF_STORE_H_ | 110 #endif // CHROME_BROWSER_PREFS_TRACKED_SEGREGATED_PREF_STORE_H_ |
| OLD | NEW |