Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(106)

Side by Side Diff: chrome/browser/prefs/tracked/segregated_pref_store.h

Issue 1148323005: Add the ability to schedule any pending lossy prefs to be written. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: oops Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698