| 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 COMPONENTS_USER_PREFS_TRACKED_SEGREGATED_PREF_STORE_H_ | 5 #ifndef COMPONENTS_USER_PREFS_TRACKED_SEGREGATED_PREF_STORE_H_ |
| 6 #define COMPONENTS_USER_PREFS_TRACKED_SEGREGATED_PREF_STORE_H_ | 6 #define COMPONENTS_USER_PREFS_TRACKED_SEGREGATED_PREF_STORE_H_ |
| 7 | 7 |
| 8 #include <stdint.h> |
| 9 |
| 8 #include <set> | 10 #include <set> |
| 9 #include <string> | 11 #include <string> |
| 10 | 12 |
| 11 #include "base/compiler_specific.h" | 13 #include "base/compiler_specific.h" |
| 12 #include "base/macros.h" | 14 #include "base/macros.h" |
| 13 #include "base/memory/ref_counted.h" | 15 #include "base/memory/ref_counted.h" |
| 14 #include "base/memory/scoped_ptr.h" | 16 #include "base/memory/scoped_ptr.h" |
| 15 #include "base/observer_list.h" | 17 #include "base/observer_list.h" |
| 16 #include "base/prefs/persistent_pref_store.h" | 18 #include "base/prefs/persistent_pref_store.h" |
| 17 | 19 |
| (...skipping 29 matching lines...) Expand all Loading... |
| 47 void AddObserver(Observer* observer) override; | 49 void AddObserver(Observer* observer) override; |
| 48 void RemoveObserver(Observer* observer) override; | 50 void RemoveObserver(Observer* observer) override; |
| 49 bool HasObservers() const override; | 51 bool HasObservers() const override; |
| 50 bool IsInitializationComplete() const override; | 52 bool IsInitializationComplete() const override; |
| 51 bool GetValue(const std::string& key, | 53 bool GetValue(const std::string& key, |
| 52 const base::Value** result) const override; | 54 const base::Value** result) const override; |
| 53 | 55 |
| 54 // WriteablePrefStore implementation | 56 // WriteablePrefStore implementation |
| 55 void SetValue(const std::string& key, | 57 void SetValue(const std::string& key, |
| 56 scoped_ptr<base::Value> value, | 58 scoped_ptr<base::Value> value, |
| 57 uint32 flags) override; | 59 uint32_t flags) override; |
| 58 void RemoveValue(const std::string& key, uint32 flags) override; | 60 void RemoveValue(const std::string& key, uint32_t flags) override; |
| 59 | 61 |
| 60 // PersistentPrefStore implementation | 62 // PersistentPrefStore implementation |
| 61 bool GetMutableValue(const std::string& key, base::Value** result) override; | 63 bool GetMutableValue(const std::string& key, base::Value** result) override; |
| 62 void ReportValueChanged(const std::string& key, uint32 flags) override; | 64 void ReportValueChanged(const std::string& key, uint32_t flags) override; |
| 63 void SetValueSilently(const std::string& key, | 65 void SetValueSilently(const std::string& key, |
| 64 scoped_ptr<base::Value> value, | 66 scoped_ptr<base::Value> value, |
| 65 uint32 flags) override; | 67 uint32_t flags) override; |
| 66 bool ReadOnly() const override; | 68 bool ReadOnly() const override; |
| 67 PrefReadError GetReadError() const override; | 69 PrefReadError GetReadError() const override; |
| 68 PrefReadError ReadPrefs() override; | 70 PrefReadError ReadPrefs() override; |
| 69 void ReadPrefsAsync(ReadErrorDelegate* error_delegate) override; | 71 void ReadPrefsAsync(ReadErrorDelegate* error_delegate) override; |
| 70 void CommitPendingWrite() override; | 72 void CommitPendingWrite() override; |
| 71 void SchedulePendingLossyWrites() override; | 73 void SchedulePendingLossyWrites() override; |
| 72 | 74 |
| 73 private: | 75 private: |
| 74 // Aggregates events from the underlying stores and synthesizes external | 76 // Aggregates events from the underlying stores and synthesizes external |
| 75 // events via |on_initialization|, |read_error_delegate_|, and |observers_|. | 77 // events via |on_initialization|, |read_error_delegate_|, and |observers_|. |
| (...skipping 25 matching lines...) Expand all Loading... |
| 101 std::set<std::string> selected_preference_names_; | 103 std::set<std::string> selected_preference_names_; |
| 102 | 104 |
| 103 scoped_ptr<PersistentPrefStore::ReadErrorDelegate> read_error_delegate_; | 105 scoped_ptr<PersistentPrefStore::ReadErrorDelegate> read_error_delegate_; |
| 104 base::ObserverList<PrefStore::Observer, true> observers_; | 106 base::ObserverList<PrefStore::Observer, true> observers_; |
| 105 AggregatingObserver aggregating_observer_; | 107 AggregatingObserver aggregating_observer_; |
| 106 | 108 |
| 107 DISALLOW_COPY_AND_ASSIGN(SegregatedPrefStore); | 109 DISALLOW_COPY_AND_ASSIGN(SegregatedPrefStore); |
| 108 }; | 110 }; |
| 109 | 111 |
| 110 #endif // COMPONENTS_PREFS_TRACKED_SEGREGATED_PREF_STORE_H_ | 112 #endif // COMPONENTS_PREFS_TRACKED_SEGREGATED_PREF_STORE_H_ |
| OLD | NEW |