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

Unified Diff: chrome/common/json_pref_store.h

Issue 6894020: Adds async interface method to PersistentPrefStore. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: always call OnInit.. 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/json_pref_store.h
diff --git a/chrome/common/json_pref_store.h b/chrome/common/json_pref_store.h
index d8da37d08f1c5b34906c1334c7372a6f96a0f6ae..4c2100bca2a8b2c5307e08f278a9ca75949ebf98 100644
--- a/chrome/common/json_pref_store.h
+++ b/chrome/common/json_pref_store.h
@@ -51,15 +51,17 @@ class JsonPrefStore : public PersistentPrefStore,
virtual void RemoveValue(const std::string& key);
virtual bool ReadOnly() const;
virtual PrefReadError ReadPrefs();
- // todo(altimofeev): move it to the PersistentPrefStore inteface.
- void ReadPrefs(Delegate* delegate);
+ virtual void ReadPrefsAsync();
+ virtual void GetErrors(PrefReadError* error, bool* is_fatal);
virtual bool WritePrefs();
virtual void ScheduleWritePrefs();
virtual void CommitPendingWrite();
virtual void ReportValueChanged(const std::string& key);
// This method is called after JSON file has been read. Method takes
- // ownership of the |value| pointer.
+ // ownership of the |value| pointer. Note, this method is used with
+ // asynchronous file reading, so class exposes it only for the internal needs.
+ // (read: do not call it manually).
void OnFileRead(Value* value_owned, PrefReadError error, bool no_dir);
private:
@@ -77,7 +79,8 @@ class JsonPrefStore : public PersistentPrefStore,
ObserverList<PrefStore::Observer, true> observers_;
- Delegate* delegate_;
+ PrefReadError error_;
+ bool is_fatal_;
DISALLOW_COPY_AND_ASSIGN(JsonPrefStore);
};

Powered by Google App Engine
This is Rietveld 408576698