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

Unified Diff: chrome/common/persistent_pref_store.h

Issue 6894020: Adds async interface method to PersistentPrefStore. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: nits Created 9 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: chrome/common/persistent_pref_store.h
diff --git a/chrome/common/persistent_pref_store.h b/chrome/common/persistent_pref_store.h
index 620fee8fabdce6839b0132a36408a6ec207a4a75..0f007c5a6b1c3530e743eb4383093ea6dabcd5cd 100644
--- a/chrome/common/persistent_pref_store.h
+++ b/chrome/common/persistent_pref_store.h
@@ -34,6 +34,13 @@ class PersistentPrefStore : public PrefStore {
PREF_READ_ERROR_FILE_NOT_SPECIFIED
};
+ class ReadErrorDelegate {
+ public:
+ virtual ~ReadErrorDelegate() {}
+
+ virtual void OnError(PrefReadError error) = 0;
+ };
+
// Equivalent to PrefStore::GetValue but returns a mutable value.
virtual ReadResult GetMutableValue(const std::string& key,
Value** result) = 0;
@@ -62,9 +69,16 @@ class PersistentPrefStore : public PrefStore {
// read errors during startup.
virtual bool ReadOnly() const = 0;
- // Reads the preferences from disk.
+ // Reads the preferences from disk. Notifies observers via
+ // "PrefStore::OnInitializationCompleted" when done.
virtual PrefReadError ReadPrefs() = 0;
+ // Reads the preferences from disk asynchronously. Notifies observers via
+ // "PrefStore::OnInitializationCompleted" when done. Also it fires
Mattias Nissler (ping if slow) 2011/05/04 23:33:08 So we still have two callback mechanisms? Seems li
altimofeev 2011/05/05 12:59:28 Yes, there are two of them. But the only reason wh
Mattias Nissler (ping if slow) 2011/05/07 00:24:14 You are very right, in this case it makes sense to
+ // |error_delegate| if it is not NULL and reading error has occurred.
+ // Owns |error_delegate|.
+ virtual void ReadPrefsAsync(ReadErrorDelegate* error_delegate) = 0;
+
// Writes the preferences to disk immediately.
virtual bool WritePrefs() = 0;

Powered by Google App Engine
This is Rietveld 408576698