diff options
author | bauerb@chromium.org <bauerb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-12-27 16:41:48 +0000 |
---|---|---|
committer | bauerb@chromium.org <bauerb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-12-27 16:41:48 +0000 |
commit | fbe17c8a2baf508c2ce5210a1322331d0c011ce3 (patch) | |
tree | 7c996389f4673186d2637bbab576776691a40a0a /chrome/common | |
parent | 3eff133b651ca64430e0ab105b132f08cfc9df58 (diff) | |
download | chromium_src-fbe17c8a2baf508c2ce5210a1322331d0c011ce3.zip chromium_src-fbe17c8a2baf508c2ce5210a1322331d0c011ce3.tar.gz chromium_src-fbe17c8a2baf508c2ce5210a1322331d0c011ce3.tar.bz2 |
Remove PrefService::ScheduleSavePersistentPrefs and change SavePersistentPrefs calls to CommitPendingWrites.
TBR=ncarter@chromium.org
BUG=99306
TEST=none
Review URL: http://codereview.chromium.org/8198007
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@115829 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common')
-rw-r--r-- | chrome/common/json_pref_store.cc | 20 | ||||
-rw-r--r-- | chrome/common/json_pref_store.h | 3 | ||||
-rw-r--r-- | chrome/common/json_pref_store_unittest.cc | 2 | ||||
-rw-r--r-- | chrome/common/persistent_pref_store.h | 6 |
4 files changed, 2 insertions, 29 deletions
diff --git a/chrome/common/json_pref_store.cc b/chrome/common/json_pref_store.cc index 4fe393a..ccb6398 100644 --- a/chrome/common/json_pref_store.cc +++ b/chrome/common/json_pref_store.cc @@ -282,26 +282,6 @@ PersistentPrefStore::PrefReadError JsonPrefStore::ReadPrefs() { return error; } -bool JsonPrefStore::WritePrefs() { - std::string data; - if (!SerializeData(&data)) - return false; - - // Don't actually write prefs if we're read-only or don't have any pending - // writes. - // TODO(bauerb): Make callers of this method call CommitPendingWrite directly. - if (writer_.HasPendingWrite() && !read_only_) - writer_.WriteNow(data); - - return true; -} - -void JsonPrefStore::ScheduleWritePrefs() { - // Writing prefs should be scheduled automatically, so this is a no-op - // for now. - // TODO(bauerb): Remove calls to this method. -} - void JsonPrefStore::CommitPendingWrite() { if (writer_.HasPendingWrite() && !read_only_) writer_.DoScheduledWrite(); diff --git a/chrome/common/json_pref_store.h b/chrome/common/json_pref_store.h index 1094a22..fbd1a6f 100644 --- a/chrome/common/json_pref_store.h +++ b/chrome/common/json_pref_store.h @@ -9,6 +9,7 @@ #include <string> #include "base/basictypes.h" +#include "base/compiler_specific.h" #include "base/file_path.h" #include "base/memory/scoped_ptr.h" #include "base/observer_list.h" @@ -50,8 +51,6 @@ class JsonPrefStore : public PersistentPrefStore, virtual bool ReadOnly() const OVERRIDE; virtual PrefReadError ReadPrefs() OVERRIDE; virtual void ReadPrefsAsync(ReadErrorDelegate* error_delegate) OVERRIDE; - virtual bool WritePrefs() OVERRIDE; - virtual void ScheduleWritePrefs() OVERRIDE; virtual void CommitPendingWrite() OVERRIDE; virtual void ReportValueChanged(const std::string& key) OVERRIDE; diff --git a/chrome/common/json_pref_store_unittest.cc b/chrome/common/json_pref_store_unittest.cc index 247aaf0..05d2493 100644 --- a/chrome/common/json_pref_store_unittest.cc +++ b/chrome/common/json_pref_store_unittest.cc @@ -152,7 +152,7 @@ void RunBasicJsonPrefStoreTest(JsonPrefStore *pref_store, // Serialize and compare to expected output. ASSERT_TRUE(file_util::PathExists(golden_output_file)); - ASSERT_TRUE(pref_store->WritePrefs()); + pref_store->CommitPendingWrite(); MessageLoop::current()->RunAllPending(); EXPECT_TRUE(file_util::TextContentsEqual(golden_output_file, output_file)); ASSERT_TRUE(file_util::Delete(output_file, false)); diff --git a/chrome/common/persistent_pref_store.h b/chrome/common/persistent_pref_store.h index b7aaf8e..0c567a1 100644 --- a/chrome/common/persistent_pref_store.h +++ b/chrome/common/persistent_pref_store.h @@ -80,12 +80,6 @@ class PersistentPrefStore : public PrefStore { // Owns |error_delegate|. virtual void ReadPrefsAsync(ReadErrorDelegate* error_delegate) = 0; - // Writes the preferences to disk immediately. - virtual bool WritePrefs() = 0; - - // Schedules an asynchronous write operation. - virtual void ScheduleWritePrefs() = 0; - // Lands any pending writes to disk. virtual void CommitPendingWrite() = 0; }; |