diff options
author | phajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-08 14:41:08 +0000 |
---|---|---|
committer | phajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-08 14:41:08 +0000 |
commit | 6c116404c0e4ebcbfea94ff91e0979bee67222e4 (patch) | |
tree | c749a0f0f2f538ed7651da2f0cda4a5667cd8fcc /chrome/common/pref_service.h | |
parent | 6f45d5f57decad87b06a63239d77657ed458e361 (diff) | |
download | chromium_src-6c116404c0e4ebcbfea94ff91e0979bee67222e4.zip chromium_src-6c116404c0e4ebcbfea94ff91e0979bee67222e4.tar.gz chromium_src-6c116404c0e4ebcbfea94ff91e0979bee67222e4.tar.bz2 |
Converted BookmarkStorage to use ImportantFileWriter
Also made BookmarkStorage completely responsible for
migration of bookmark data from history database.
Previously the logic crossed file and class boundaries a few
times. This made it a bit hard to follow. Now it should be
a bit more clear.
Made ImportantFileWriter also batch data serializations.
TEST=Make sure that bookmarks still work. Also test migrating bookmarks from history database.
http://crbug.com/10618
Review URL: http://codereview.chromium.org/99192
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@15635 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common/pref_service.h')
-rw-r--r-- | chrome/common/pref_service.h | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/chrome/common/pref_service.h b/chrome/common/pref_service.h index b60f497..c4f7ce6 100644 --- a/chrome/common/pref_service.h +++ b/chrome/common/pref_service.h @@ -32,7 +32,8 @@ namespace base { class Thread; } -class PrefService : public NonThreadSafe { +class PrefService : public NonThreadSafe, + public ImportantFileWriter::DataSerializer { public: // A helper class to store all the information associated with a preference. @@ -96,7 +97,7 @@ class PrefService : public NonThreadSafe { bool SavePersistentPrefs(); // Serializes the data and schedules save using ImportantFileWriter. - bool ScheduleSavePersistentPrefs(); + void ScheduleSavePersistentPrefs(); DictionaryValue* transient() { return transient_.get(); } @@ -191,6 +192,9 @@ class PrefService : public NonThreadSafe { // preference is not registered. const Preference* FindPreference(const wchar_t* pref_name) const; + // ImportantFileWriter::DataSerializer + virtual bool SerializeData(std::string* output); + private: // Add a preference to the PreferenceMap. If the pref already exists, return // false. This method takes ownership of |pref|. @@ -208,10 +212,6 @@ class PrefService : public NonThreadSafe { void FireObserversIfChanged(const wchar_t* pref_name, const Value* old_value); - // Serializes stored data to string. |output| is modified only - // if serialization was successful. Returns true on success. - bool SerializePrefData(std::string* output) const; - scoped_ptr<DictionaryValue> persistent_; scoped_ptr<DictionaryValue> transient_; |