summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chrome/browser/background/background_contents_service.cc2
-rw-r--r--chrome/browser/bookmarks/bookmark_utils.cc1
-rw-r--r--chrome/browser/browser_process_impl.cc2
-rw-r--r--chrome/browser/browser_shutdown.cc2
-rw-r--r--chrome/browser/chrome_browser_main.cc1
-rw-r--r--chrome/browser/chromeos/accessibility/accessibility_util.cc2
-rw-r--r--chrome/browser/chromeos/audio_mixer_alsa.cc2
-rw-r--r--chrome/browser/chromeos/locale_change_guard.cc5
-rw-r--r--chrome/browser/chromeos/login/base_login_display_host.cc2
-rw-r--r--chrome/browser/chromeos/login/language_switch_menu.cc3
-rw-r--r--chrome/browser/chromeos/login/login_utils.cc1
-rw-r--r--chrome/browser/chromeos/login/wizard_controller.cc6
-rw-r--r--chrome/browser/chromeos/status/input_method_menu.cc2
-rw-r--r--chrome/browser/content_settings/content_settings_pref_provider.cc3
-rw-r--r--chrome/browser/custom_handlers/protocol_handler_registry.cc1
-rw-r--r--chrome/browser/extensions/apps_promo.cc1
-rw-r--r--chrome/browser/extensions/default_apps.cc1
-rw-r--r--chrome/browser/extensions/extension_prefs.cc18
-rw-r--r--chrome/browser/extensions/extension_prefs.h5
-rw-r--r--chrome/browser/extensions/extension_service_unittest.cc2
-rw-r--r--chrome/browser/extensions/extension_toolbar_model.cc1
-rw-r--r--chrome/browser/extensions/extension_updater.cc2
-rw-r--r--chrome/browser/extensions/test_extension_prefs.cc2
-rw-r--r--chrome/browser/geolocation/chrome_geolocation_permission_context.cc1
-rw-r--r--chrome/browser/importer/profile_writer.cc8
-rw-r--r--chrome/browser/metrics/metrics_service.cc8
-rw-r--r--chrome/browser/prefs/overlay_user_pref_store.cc10
-rw-r--r--chrome/browser/prefs/overlay_user_pref_store.h2
-rw-r--r--chrome/browser/prefs/pref_service.cc10
-rw-r--r--chrome/browser/prefs/pref_service.h13
-rw-r--r--chrome/browser/prefs/testing_pref_store.cc13
-rw-r--r--chrome/browser/prefs/testing_pref_store.h4
-rw-r--r--chrome/browser/profiles/profile_impl.cc7
-rw-r--r--chrome/browser/search_engines/template_url_service.cc2
-rw-r--r--chrome/browser/sync/signin_manager.cc3
-rw-r--r--chrome/browser/sync/sync_prefs.cc10
-rw-r--r--chrome/browser/tabs/pinned_tab_codec.cc1
-rw-r--r--chrome/browser/translate/translate_prefs.cc29
-rw-r--r--chrome/browser/ui/auto_login_prompter.cc1
-rw-r--r--chrome/browser/ui/browser.cc1
-rw-r--r--chrome/browser/ui/browser_init.cc1
-rw-r--r--chrome/browser/ui/browser_list.cc3
-rw-r--r--chrome/browser/ui/webui/options/core_options_handler.cc3
-rw-r--r--chrome/browser/ui/webui/options2/core_options_handler2.cc3
-rw-r--r--chrome/common/json_pref_store.cc20
-rw-r--r--chrome/common/json_pref_store.h3
-rw-r--r--chrome/common/json_pref_store_unittest.cc2
-rw-r--r--chrome/common/persistent_pref_store.h6
-rw-r--r--chrome/service/service_process_prefs.cc2
49 files changed, 27 insertions, 206 deletions
diff --git a/chrome/browser/background/background_contents_service.cc b/chrome/browser/background/background_contents_service.cc
index 098af80..47343b9 100644
--- a/chrome/browser/background/background_contents_service.cc
+++ b/chrome/browser/background/background_contents_service.cc
@@ -502,7 +502,6 @@ void BackgroundContentsService::RegisterBackgroundContents(
dict->SetString(kUrlKey, background_contents->GetURL().spec());
dict->SetString(kFrameNameKey, contents_map_[appid].frame_name);
pref->SetWithoutPathExpansion(UTF16ToUTF8(appid), dict);
- prefs_->ScheduleSavePersistentPrefs();
}
void BackgroundContentsService::UnregisterBackgroundContents(
@@ -513,7 +512,6 @@ void BackgroundContentsService::UnregisterBackgroundContents(
const string16 appid = GetParentApplicationId(background_contents);
DictionaryPrefUpdate update(prefs_, prefs::kRegisteredBackgroundContents);
update.Get()->RemoveWithoutPathExpansion(UTF16ToUTF8(appid), NULL);
- prefs_->ScheduleSavePersistentPrefs();
}
void BackgroundContentsService::ShutdownAssociatedBackgroundContents(
diff --git a/chrome/browser/bookmarks/bookmark_utils.cc b/chrome/browser/bookmarks/bookmark_utils.cc
index aef0203..0cba25c 100644
--- a/chrome/browser/bookmarks/bookmark_utils.cc
+++ b/chrome/browser/bookmarks/bookmark_utils.cc
@@ -649,7 +649,6 @@ void ToggleWhenVisible(Profile* profile) {
// The user changed when the bookmark bar is shown, update the preferences.
prefs->SetBoolean(prefs::kShowBookmarkBar, always_show);
- prefs->ScheduleSavePersistentPrefs();
}
void RegisterUserPrefs(PrefService* prefs) {
diff --git a/chrome/browser/browser_process_impl.cc b/chrome/browser/browser_process_impl.cc
index 0ad4f4d..c4f1af6 100644
--- a/chrome/browser/browser_process_impl.cc
+++ b/chrome/browser/browser_process_impl.cc
@@ -366,7 +366,7 @@ void BrowserProcessImpl::EndSession() {
metrics->RecordStartOfSessionEnd();
// MetricsService lazily writes to prefs, force it to write now.
- local_state()->SavePersistentPrefs();
+ local_state()->CommitPendingWrite();
}
// We must write that the profile and metrics service shutdown cleanly,
diff --git a/chrome/browser/browser_shutdown.cc b/chrome/browser/browser_shutdown.cc
index 7f46b5e..d0b12b37 100644
--- a/chrome/browser/browser_shutdown.cc
+++ b/chrome/browser/browser_shutdown.cc
@@ -154,7 +154,7 @@ bool ShutdownPreThreadsStop() {
prefs->ClearPref(prefs::kRestartLastSessionOnShutdown);
}
- prefs->SavePersistentPrefs();
+ prefs->CommitPendingWrite();
#if defined(OS_WIN) && defined(GOOGLE_CHROME_BUILD)
// Cleanup any statics created by RLZ. Must be done before NotificationService
diff --git a/chrome/browser/chrome_browser_main.cc b/chrome/browser/chrome_browser_main.cc
index 3d6fb49..c6a96bd 100644
--- a/chrome/browser/chrome_browser_main.cc
+++ b/chrome/browser/chrome_browser_main.cc
@@ -373,7 +373,6 @@ PrefService* InitializeLocalState(const CommandLine& parsed_command_line,
local_state->GetString(prefs::kApplicationLocale) != owner_locale &&
!local_state->IsManagedPreference(prefs::kApplicationLocale)) {
local_state->SetString(prefs::kApplicationLocale, owner_locale);
- local_state->ScheduleSavePersistentPrefs();
}
}
#endif
diff --git a/chrome/browser/chromeos/accessibility/accessibility_util.cc b/chrome/browser/chromeos/accessibility/accessibility_util.cc
index 6847556..9e36b7e 100644
--- a/chrome/browser/chromeos/accessibility/accessibility_util.cc
+++ b/chrome/browser/chromeos/accessibility/accessibility_util.cc
@@ -95,7 +95,7 @@ void EnableAccessibility(bool enabled, WebUI* login_web_ui) {
g_browser_process->local_state()->SetBoolean(
prefs::kSpokenFeedbackEnabled, enabled);
- g_browser_process->local_state()->ScheduleSavePersistentPrefs();
+ g_browser_process->local_state()->CommitPendingWrite();
ExtensionAccessibilityEventRouter::GetInstance()->
SetAccessibilityEnabled(enabled);
BrowserAccessibilityState::GetInstance()->OnAccessibilityEnabledManually();
diff --git a/chrome/browser/chromeos/audio_mixer_alsa.cc b/chrome/browser/chromeos/audio_mixer_alsa.cc
index a380c31..3bdc1e4 100644
--- a/chrome/browser/chromeos/audio_mixer_alsa.cc
+++ b/chrome/browser/chromeos/audio_mixer_alsa.cc
@@ -142,7 +142,6 @@ void AudioMixerAlsa::SetVolumeDb(double volume_db) {
}
prefs_->SetDouble(prefs::kAudioVolume, volume_db);
- prefs_->ScheduleSavePersistentPrefs();
base::AutoLock lock(lock_);
volume_db_ = volume_db;
@@ -159,7 +158,6 @@ bool AudioMixerAlsa::IsMuted() {
void AudioMixerAlsa::SetMuted(bool muted) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
prefs_->SetInteger(prefs::kAudioMute, muted ? kPrefMuteOn : kPrefMuteOff);
- prefs_->ScheduleSavePersistentPrefs();
base::AutoLock lock(lock_);
is_muted_ = muted;
if (!apply_is_pending_)
diff --git a/chrome/browser/chromeos/locale_change_guard.cc b/chrome/browser/chromeos/locale_change_guard.cc
index 896b85e..62b73c2 100644
--- a/chrome/browser/chromeos/locale_change_guard.cc
+++ b/chrome/browser/chromeos/locale_change_guard.cc
@@ -107,10 +107,8 @@ void LocaleChangeGuard::Observe(int type,
}
std::string owner_locale =
prefs->GetString(prefs::kApplicationLocale);
- if (!owner_locale.empty()) {
+ if (!owner_locale.empty())
local_state->SetString(prefs::kOwnerLocale, owner_locale);
- local_state->ScheduleSavePersistentPrefs();
- }
}
}
break;
@@ -198,7 +196,6 @@ void LocaleChangeGuard::AcceptLocaleChange() {
content::RecordAction(UserMetricsAction("LanguageChange_Accept"));
prefs->SetString(prefs::kApplicationLocaleBackup, to_locale_);
prefs->SetString(prefs::kApplicationLocaleAccepted, to_locale_);
- prefs->ScheduleSavePersistentPrefs();
}
void LocaleChangeGuard::PrepareChangingLocale(
diff --git a/chrome/browser/chromeos/login/base_login_display_host.cc b/chrome/browser/chromeos/login/base_login_display_host.cc
index b53fffa..487d63ce 100644
--- a/chrome/browser/chromeos/login/base_login_display_host.cc
+++ b/chrome/browser/chromeos/login/base_login_display_host.cc
@@ -125,7 +125,7 @@ void DetermineAndSaveHardwareKeyboard(const std::string& locale,
// The latest values of Local State reside in memory so we can safely
// get the value of kHardwareKeyboardLayout even if the data is not
// yet saved to disk.
- prefs->SavePersistentPrefs();
+ prefs->CommitPendingWrite();
}
}
diff --git a/chrome/browser/chromeos/login/language_switch_menu.cc b/chrome/browser/chromeos/login/language_switch_menu.cc
index b873bbe..7fc5130 100644
--- a/chrome/browser/chromeos/login/language_switch_menu.cc
+++ b/chrome/browser/chromeos/login/language_switch_menu.cc
@@ -118,11 +118,8 @@ bool LanguageSwitchMenu::SwitchLanguage(const std::string& locale) {
// future..
g_browser_process->SetApplicationLocale(locale);
- // Force preferences save, otherwise they won't be saved on
- // shutdown from login screen. http://crosbug.com/20747
PrefService* prefs = g_browser_process->local_state();
prefs->SetString(prefs::kApplicationLocale, locale);
- prefs->ScheduleSavePersistentPrefs();
return true;
}
diff --git a/chrome/browser/chromeos/login/login_utils.cc b/chrome/browser/chromeos/login/login_utils.cc
index 5734bdf..73735e8 100644
--- a/chrome/browser/chromeos/login/login_utils.cc
+++ b/chrome/browser/chromeos/login/login_utils.cc
@@ -1067,7 +1067,6 @@ void LoginUtilsImpl::SetFirstLoginPrefs(PrefService* prefs) {
language_preferred_languages.Init(prefs::kLanguagePreferredLanguages,
prefs, NULL);
language_preferred_languages.SetValue(JoinString(language_codes, ','));
- prefs->ScheduleSavePersistentPrefs();
}
scoped_refptr<Authenticator> LoginUtilsImpl::CreateAuthenticator(
diff --git a/chrome/browser/chromeos/login/wizard_controller.cc b/chrome/browser/chromeos/login/wizard_controller.cc
index 0e52193..aa1f02c 100644
--- a/chrome/browser/chromeos/login/wizard_controller.cc
+++ b/chrome/browser/chromeos/login/wizard_controller.cc
@@ -78,14 +78,14 @@ static int kShowDelayMs = 400;
void SaveBoolPreferenceForced(const char* pref_name, bool value) {
PrefService* prefs = g_browser_process->local_state();
prefs->SetBoolean(pref_name, value);
- prefs->SavePersistentPrefs();
+ prefs->CommitPendingWrite();
}
// Saves integer "Local State" preference and forces its persistence to disk.
void SaveIntegerPreferenceForced(const char* pref_name, int value) {
PrefService* prefs = g_browser_process->local_state();
prefs->SetInteger(pref_name, value);
- prefs->SavePersistentPrefs();
+ prefs->CommitPendingWrite();
}
// Saves string "Local State" preference and forces its persistence to disk.
@@ -93,7 +93,7 @@ void SaveStringPreferenceForced(const char* pref_name,
const std::string& value) {
PrefService* prefs = g_browser_process->local_state();
prefs->SetString(pref_name, value);
- prefs->SavePersistentPrefs();
+ prefs->CommitPendingWrite();
}
} // namespace
diff --git a/chrome/browser/chromeos/status/input_method_menu.cc b/chrome/browser/chromeos/status/input_method_menu.cc
index 77886a60..b938b14 100644
--- a/chrome/browser/chromeos/status/input_method_menu.cc
+++ b/chrome/browser/chromeos/status/input_method_menu.cc
@@ -422,13 +422,11 @@ void InputMethodMenu::PreferenceUpdateNeeded(
// Sometimes (e.g. initial boot) |previous_input_method.id()| is empty.
previous_input_method_pref_.SetValue(previous_input_method.id());
current_input_method_pref_.SetValue(current_input_method.id());
- pref_service_->ScheduleSavePersistentPrefs();
}
} else if (StatusAreaViewChromeos::IsLoginMode()) {
if (g_browser_process && g_browser_process->local_state()) {
g_browser_process->local_state()->SetString(
language_prefs::kPreferredKeyboardLayout, current_input_method.id());
- g_browser_process->local_state()->ScheduleSavePersistentPrefs();
}
}
}
diff --git a/chrome/browser/content_settings/content_settings_pref_provider.cc b/chrome/browser/content_settings/content_settings_pref_provider.cc
index 24a765e..8c7f2e4 100644
--- a/chrome/browser/content_settings/content_settings_pref_provider.cc
+++ b/chrome/browser/content_settings/content_settings_pref_provider.cc
@@ -201,7 +201,6 @@ bool PrefProvider::SetWebsiteSetting(
content_type,
resource_identifier,
value.get());
- prefs_->ScheduleSavePersistentPrefs();
}
NotifyObservers(
@@ -229,7 +228,6 @@ void PrefProvider::ClearAllContentSettingsRules(
rules_to_delete.push_back(rule_iterator->Next());
map_to_modify->DeleteValues(content_type, "");
- prefs_->ScheduleSavePersistentPrefs();
}
for (std::vector<Rule>::const_iterator it = rules_to_delete.begin();
@@ -276,7 +274,6 @@ void PrefProvider::Observe(
return;
}
}
- prefs_->ScheduleSavePersistentPrefs();
ReadContentSettingsFromPref(true);
NotifyObservers(ContentSettingsPattern(),
diff --git a/chrome/browser/custom_handlers/protocol_handler_registry.cc b/chrome/browser/custom_handlers/protocol_handler_registry.cc
index 2c5ea8d..bcf9e24 100644
--- a/chrome/browser/custom_handlers/protocol_handler_registry.cc
+++ b/chrome/browser/custom_handlers/protocol_handler_registry.cc
@@ -257,7 +257,6 @@ void ProtocolHandlerRegistry::Save() {
profile_->GetPrefs()->Set(prefs::kIgnoredProtocolHandlers,
*ignored_protocol_handlers);
profile_->GetPrefs()->Set(prefs::kCustomHandlersEnabled, *enabled);
- profile_->GetPrefs()->ScheduleSavePersistentPrefs();
}
bool ProtocolHandlerRegistry::CanSchemeBeOverridden(
diff --git a/chrome/browser/extensions/apps_promo.cc b/chrome/browser/extensions/apps_promo.cc
index e5c9681..44b5982 100644
--- a/chrome/browser/extensions/apps_promo.cc
+++ b/chrome/browser/extensions/apps_promo.cc
@@ -296,7 +296,6 @@ int AppsPromo::GetPromoCounter() const {
void AppsPromo::SetPromoCounter(int val) {
prefs_->SetInteger(prefs::kAppsPromoCounter, val);
- prefs_->ScheduleSavePersistentPrefs();
}
bool AppsPromo::GetDefaultAppsInstalled() const {
diff --git a/chrome/browser/extensions/default_apps.cc b/chrome/browser/extensions/default_apps.cc
index d4a2cf8..7701184 100644
--- a/chrome/browser/extensions/default_apps.cc
+++ b/chrome/browser/extensions/default_apps.cc
@@ -102,7 +102,6 @@ static bool ShouldInstallInProfile(Profile* profile) {
profile->GetPrefs()->SetInteger(prefs::kDefaultAppsInstallState,
default_apps::kNeverProvideDefaultApps);
}
- profile->GetPrefs()->ScheduleSavePersistentPrefs();
}
return install_apps;
diff --git a/chrome/browser/extensions/extension_prefs.cc b/chrome/browser/extensions/extension_prefs.cc
index c70e268..493ba5a 100644
--- a/chrome/browser/extensions/extension_prefs.cc
+++ b/chrome/browser/extensions/extension_prefs.cc
@@ -174,11 +174,9 @@ class ScopedExtensionPrefUpdate : public DictionaryPrefUpdate {
ScopedExtensionPrefUpdate(PrefService* service,
const std::string& extension_id) :
DictionaryPrefUpdate(service, ExtensionPrefs::kExtensionsPref),
- prefs_(service),
extension_id_(extension_id) {}
virtual ~ScopedExtensionPrefUpdate() {
- prefs_->ScheduleSavePersistentPrefs();
}
virtual DictionaryValue* Get() {
@@ -193,7 +191,6 @@ class ScopedExtensionPrefUpdate : public DictionaryPrefUpdate {
}
private:
- PrefService* prefs_;
const std::string extension_id_;
DISALLOW_COPY_AND_ASSIGN(ScopedExtensionPrefUpdate);
@@ -210,12 +207,10 @@ class ScopedExtensionControlledPrefUpdate : public DictionaryPrefUpdate {
const std::string& extension_id,
const std::string& incognito_or_regular_path) :
DictionaryPrefUpdate(service, ExtensionPrefs::kExtensionsPref),
- prefs_(service),
extension_id_(extension_id),
incognito_or_regular_path_(incognito_or_regular_path) {}
virtual ~ScopedExtensionControlledPrefUpdate() {
- prefs_->ScheduleSavePersistentPrefs();
}
virtual DictionaryValue* Get() {
@@ -231,7 +226,6 @@ class ScopedExtensionControlledPrefUpdate : public DictionaryPrefUpdate {
}
private:
- PrefService* prefs_;
const std::string extension_id_;
const std::string incognito_or_regular_path_;
@@ -325,7 +319,6 @@ void ExtensionPrefs::MakePathsRelative() {
extension_dict->SetString(kPrefPath,
MakePathRelative(install_directory_, path));
}
- SavePrefs();
}
void ExtensionPrefs::MakePathsAbsolute(DictionaryValue* dict) {
@@ -542,10 +535,6 @@ void ExtensionPrefs::SetExtensionPrefPermissionSet(
}
}
-void ExtensionPrefs::SavePrefs() {
- prefs_->ScheduleSavePersistentPrefs();
-}
-
// static
bool ExtensionPrefs::IsBlacklistBitSet(DictionaryValue* ext) {
return ReadBooleanFromPref(ext, kPrefBlacklist);
@@ -1178,7 +1167,6 @@ void ExtensionPrefs::SetToolbarOrder(
iter != extension_ids.end(); ++iter) {
toolbar_order->Append(new StringValue(*iter));
}
- SavePrefs();
}
void ExtensionPrefs::OnExtensionInstalled(
@@ -1372,10 +1360,7 @@ void ExtensionPrefs::DeleteExtensionPrefs(const std::string& extension_id) {
content_settings_store_->UnregisterExtension(extension_id);
DictionaryPrefUpdate update(prefs_, kExtensionsPref);
DictionaryValue* dict = update.Get();
- if (dict->HasKey(extension_id)) {
- dict->Remove(extension_id, NULL);
- SavePrefs();
- }
+ dict->Remove(extension_id, NULL);
}
const DictionaryValue* ExtensionPrefs::GetExtensionPref(
@@ -1582,7 +1567,6 @@ bool ExtensionPrefs::GetWebStoreLogin(std::string* result) {
void ExtensionPrefs::SetWebStoreLogin(const std::string& login) {
prefs_->SetString(kWebStoreLogin, login);
- SavePrefs();
}
StringOrdinal ExtensionPrefs::GetMinOrMaxAppLaunchOrdinalsOnPage(
diff --git a/chrome/browser/extensions/extension_prefs.h b/chrome/browser/extensions/extension_prefs.h
index 9a99a25..5573f18 100644
--- a/chrome/browser/extensions/extension_prefs.h
+++ b/chrome/browser/extensions/extension_prefs.h
@@ -529,11 +529,6 @@ class ExtensionPrefs : public ExtensionContentSettingsStore::Observer {
const std::string& id,
bool incognito) const;
- // Serializes the data and schedules a persistent save via the |PrefService|.
- // TODO(andybons): Fire an EXTENSION_PREF_CHANGED notification to be more
- // granular than PREF_CHANGED.
- void SavePrefs();
-
// Checks if kPrefBlacklist is set to true in the DictionaryValue.
// Return false if the value is false or kPrefBlacklist does not exist.
// This is used to decide if an extension is blacklisted.
diff --git a/chrome/browser/extensions/extension_service_unittest.cc b/chrome/browser/extensions/extension_service_unittest.cc
index 53e47f7..094088e 100644
--- a/chrome/browser/extensions/extension_service_unittest.cc
+++ b/chrome/browser/extensions/extension_service_unittest.cc
@@ -2587,7 +2587,6 @@ TEST_F(ExtensionServiceTest, BlacklistedByPolicyRemovedIfRunning) {
// Blacklist this extension.
blacklist->Append(Value::CreateStringValue(good_crx));
- prefs->ScheduleSavePersistentPrefs();
}
// Extension should not be running now.
@@ -3183,7 +3182,6 @@ void ExtensionServiceTest::TestExternalProvider(
// Now clear the preference and reinstall.
SetPrefInteg(good_crx, "state", Extension::ENABLED);
- profile_->GetPrefs()->ScheduleSavePersistentPrefs();
loaded_.clear();
service_->CheckForExternalUpdates();
diff --git a/chrome/browser/extensions/extension_toolbar_model.cc b/chrome/browser/extensions/extension_toolbar_model.cc
index 24f9629..7073be4 100644
--- a/chrome/browser/extensions/extension_toolbar_model.cc
+++ b/chrome/browser/extensions/extension_toolbar_model.cc
@@ -78,7 +78,6 @@ void ExtensionToolbarModel::MoveBrowserAction(const Extension* extension,
void ExtensionToolbarModel::SetVisibleIconCount(int count) {
visible_icon_count_ = count == static_cast<int>(size()) ? -1 : count;
prefs_->SetInteger(prefs::kExtensionToolbarSize, visible_icon_count_);
- prefs_->ScheduleSavePersistentPrefs();
}
void ExtensionToolbarModel::Observe(
diff --git a/chrome/browser/extensions/extension_updater.cc b/chrome/browser/extensions/extension_updater.cc
index 86bf800..667ad19 100644
--- a/chrome/browser/extensions/extension_updater.cc
+++ b/chrome/browser/extensions/extension_updater.cc
@@ -830,7 +830,6 @@ void ExtensionUpdater::ProcessBlacklist(const std::string& data) {
// Update the pref value for blacklist version
prefs_->SetString(kExtensionBlacklistUpdateVersion,
current_extension_fetch_.version);
- prefs_->ScheduleSavePersistentPrefs();
}
void ExtensionUpdater::OnCRXFetchComplete(
@@ -959,7 +958,6 @@ void ExtensionUpdater::ScheduleNextCheck(const TimeDelta& target_delay) {
// Save the time of next check.
Time next = Time::Now() + actual_delay;
prefs_->SetInt64(kNextExtensionsUpdateCheck, next.ToInternalValue());
- prefs_->ScheduleSavePersistentPrefs();
timer_.Start(FROM_HERE, actual_delay, this, &ExtensionUpdater::TimerFired);
}
diff --git a/chrome/browser/extensions/test_extension_prefs.cc b/chrome/browser/extensions/test_extension_prefs.cc
index aa19c4e..0260046 100644
--- a/chrome/browser/extensions/test_extension_prefs.cc
+++ b/chrome/browser/extensions/test_extension_prefs.cc
@@ -73,7 +73,7 @@ void TestExtensionPrefs::RecreateExtensionPrefs() {
// need to wait for any pending I/O to complete before creating a new
// PrefService.
base::WaitableEvent io_finished(false, false);
- pref_service_->SavePersistentPrefs();
+ pref_service_-> CommitPendingWrite();
EXPECT_TRUE(BrowserThread::PostTask(
BrowserThread::FILE,
FROM_HERE,
diff --git a/chrome/browser/geolocation/chrome_geolocation_permission_context.cc b/chrome/browser/geolocation/chrome_geolocation_permission_context.cc
index b9f4552..50f1c0b 100644
--- a/chrome/browser/geolocation/chrome_geolocation_permission_context.cc
+++ b/chrome/browser/geolocation/chrome_geolocation_permission_context.cc
@@ -426,7 +426,6 @@ void GeolocationInfoBarQueueController::OnPermissionSet(
CONTENT_SETTINGS_TYPE_GEOLOCATION,
std::string(),
content_setting);
- profile_->GetPrefs()->ScheduleSavePersistentPrefs();
for (PendingInfoBarRequests::iterator i = pending_infobar_requests_.begin();
i != pending_infobar_requests_.end(); ) {
diff --git a/chrome/browser/importer/profile_writer.cc b/chrome/browser/importer/profile_writer.cc
index 9496359..501aa37 100644
--- a/chrome/browser/importer/profile_writer.cc
+++ b/chrome/browser/importer/profile_writer.cc
@@ -55,12 +55,7 @@ string16 GenerateUniqueFolderName(BookmarkModel* model,
// Shows the bookmarks toolbar.
void ShowBookmarkBar(Profile* profile) {
- PrefService* prefs = profile->GetPrefs();
- // Check whether the bookmark bar is shown in current pref.
- if (!prefs->GetBoolean(prefs::kShowBookmarkBar)) {
- prefs->SetBoolean(prefs::kShowBookmarkBar, true);
- prefs->ScheduleSavePersistentPrefs();
- }
+ profile->GetPrefs()->SetBoolean(prefs::kShowBookmarkBar, true);
}
} // namespace
@@ -115,7 +110,6 @@ void ProfileWriter::AddHomepage(const GURL& home_page) {
const PrefService::Preference* pref = prefs->FindPreference(prefs::kHomePage);
if (pref && !pref->IsManaged()) {
prefs->SetString(prefs::kHomePage, home_page.spec());
- prefs->ScheduleSavePersistentPrefs();
}
}
diff --git a/chrome/browser/metrics/metrics_service.cc b/chrome/browser/metrics/metrics_service.cc
index e034a30..3fda3d4 100644
--- a/chrome/browser/metrics/metrics_service.cc
+++ b/chrome/browser/metrics/metrics_service.cc
@@ -777,7 +777,6 @@ void MetricsService::SaveLocalState() {
}
RecordCurrentState(pref);
- pref->ScheduleSavePersistentPrefs();
// TODO(jar): Does this run down the batteries????
ScheduleNextStateSave();
@@ -1132,11 +1131,6 @@ void MetricsService::OnURLFetchComplete(const content::URLFetcher* source) {
}
log_manager_.DiscardStagedLog();
- // Since we sent a log, make sure our in-memory state is recorded to disk.
- PrefService* local_state = g_browser_process->local_state();
- DCHECK(local_state);
- if (local_state)
- local_state->ScheduleSavePersistentPrefs();
if (log_manager_.has_unsent_logs())
DCHECK(state_ < SENDING_CURRENT_LOGS);
@@ -1304,7 +1298,7 @@ void MetricsService::LogCleanShutdown() {
// Redundant hack to write pref ASAP.
PrefService* pref = g_browser_process->local_state();
pref->SetBoolean(prefs::kStabilityExitedCleanly, true);
- pref->SavePersistentPrefs();
+ pref->CommitPendingWrite();
// Hack: TBD: Remove this wait.
// We are so concerned that the pref gets written, we are now willing to stall
// the UI thread until we get assurance that a pref-writing task has
diff --git a/chrome/browser/prefs/overlay_user_pref_store.cc b/chrome/browser/prefs/overlay_user_pref_store.cc
index 8796b40..65369bb 100644
--- a/chrome/browser/prefs/overlay_user_pref_store.cc
+++ b/chrome/browser/prefs/overlay_user_pref_store.cc
@@ -114,16 +114,6 @@ void OverlayUserPrefStore::ReadPrefsAsync(
OnInitializationCompleted(true);
}
-bool OverlayUserPrefStore::WritePrefs() {
- // We do not write our content intentionally.
- return true;
-}
-
-void OverlayUserPrefStore::ScheduleWritePrefs() {
- underlay_->ScheduleWritePrefs();
- // We do not write our content intentionally.
-}
-
void OverlayUserPrefStore::CommitPendingWrite() {
underlay_->CommitPendingWrite();
// We do not write our content intentionally.
diff --git a/chrome/browser/prefs/overlay_user_pref_store.h b/chrome/browser/prefs/overlay_user_pref_store.h
index eb2cac7..593c342 100644
--- a/chrome/browser/prefs/overlay_user_pref_store.h
+++ b/chrome/browser/prefs/overlay_user_pref_store.h
@@ -47,8 +47,6 @@ class OverlayUserPrefStore : public PersistentPrefStore,
virtual bool ReadOnly() const OVERRIDE;
virtual PrefReadError ReadPrefs() OVERRIDE;
virtual void ReadPrefsAsync(ReadErrorDelegate* 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/browser/prefs/pref_service.cc b/chrome/browser/prefs/pref_service.cc
index e11a321..6ec0802 100644
--- a/chrome/browser/prefs/pref_service.cc
+++ b/chrome/browser/prefs/pref_service.cc
@@ -273,16 +273,6 @@ bool PrefService::ReloadPersistentPrefs() {
PersistentPrefStore::PREF_READ_ERROR_NONE;
}
-bool PrefService::SavePersistentPrefs() {
- DCHECK(CalledOnValidThread());
- return user_pref_store_->WritePrefs();
-}
-
-void PrefService::ScheduleSavePersistentPrefs() {
- DCHECK(CalledOnValidThread());
- user_pref_store_->ScheduleWritePrefs();
-}
-
void PrefService::CommitPendingWrite() {
DCHECK(CalledOnValidThread());
user_pref_store_->CommitPendingWrite();
diff --git a/chrome/browser/prefs/pref_service.h b/chrome/browser/prefs/pref_service.h
index 38510f8..a035de86 100644
--- a/chrome/browser/prefs/pref_service.h
+++ b/chrome/browser/prefs/pref_service.h
@@ -165,17 +165,8 @@ class PrefService : public base::NonThreadSafe {
// and is managed.
bool IsManagedPreference(const char* pref_name) const;
- // Writes the data to disk. The return value only reflects whether
- // serialization was successful; we don't know whether the data actually made
- // it on disk (since it's on a different thread). This should only be used if
- // we need to save immediately (basically, during shutdown). Otherwise, you
- // should use ScheduleSavePersistentPrefs.
- bool SavePersistentPrefs();
-
- // Serializes the data and schedules save using ImportantFileWriter.
- void ScheduleSavePersistentPrefs();
-
- // Lands pending writes to disk.
+ // Lands pending writes to disk. This should only be used if we need to save
+ // immediately (basically, during shutdown).
void CommitPendingWrite();
// Make the PrefService aware of a pref.
diff --git a/chrome/browser/prefs/testing_pref_store.cc b/chrome/browser/prefs/testing_pref_store.cc
index d080169..3c6b631 100644
--- a/chrome/browser/prefs/testing_pref_store.cc
+++ b/chrome/browser/prefs/testing_pref_store.cc
@@ -65,11 +65,6 @@ void TestingPrefStore::ReadPrefsAsync(ReadErrorDelegate* error_delegate_raw) {
NotifyInitializationCompleted();
}
-bool TestingPrefStore::WritePrefs() {
- prefs_written_ = true;
- return prefs_written_;
-}
-
void TestingPrefStore::SetInitializationCompleted() {
init_complete_ = true;
NotifyInitializationCompleted();
@@ -128,11 +123,3 @@ bool TestingPrefStore::GetBoolean(const std::string& key, bool* value) const {
void TestingPrefStore::set_read_only(bool read_only) {
read_only_ = read_only;
}
-
-void TestingPrefStore::set_prefs_written(bool status) {
- prefs_written_ = status;
-}
-
-bool TestingPrefStore::get_prefs_written() {
- return prefs_written_;
-}
diff --git a/chrome/browser/prefs/testing_pref_store.h b/chrome/browser/prefs/testing_pref_store.h
index 6770352..2651f67 100644
--- a/chrome/browser/prefs/testing_pref_store.h
+++ b/chrome/browser/prefs/testing_pref_store.h
@@ -38,8 +38,6 @@ class TestingPrefStore : public PersistentPrefStore {
virtual bool ReadOnly() const OVERRIDE;
virtual PersistentPrefStore::PrefReadError ReadPrefs() OVERRIDE;
virtual void ReadPrefsAsync(ReadErrorDelegate* error_delegate) OVERRIDE;
- virtual bool WritePrefs() OVERRIDE;
- virtual void ScheduleWritePrefs() OVERRIDE {}
virtual void CommitPendingWrite() OVERRIDE {}
// Marks the store as having completed initialization.
@@ -61,8 +59,6 @@ class TestingPrefStore : public PersistentPrefStore {
// Getter and Setter methods for setting and getting the state of the
// |TestingPrefStore|.
virtual void set_read_only(bool read_only);
- virtual void set_prefs_written(bool status);
- virtual bool get_prefs_written();
private:
// Stores the preference values.
diff --git a/chrome/browser/profiles/profile_impl.cc b/chrome/browser/profiles/profile_impl.cc
index 8ba1086b..e5bda05 100644
--- a/chrome/browser/profiles/profile_impl.cc
+++ b/chrome/browser/profiles/profile_impl.cc
@@ -758,8 +758,6 @@ void ProfileImpl::OnPrefsLoaded(bool success) {
prefs_->GetBoolean(prefs::kSessionExitedCleanly);
// Mark the session as open.
prefs_->SetBoolean(prefs::kSessionExitedCleanly, false);
- // Make sure we save to disk that the session has opened.
- prefs_->ScheduleSavePersistentPrefs();
bool extensions_disabled =
prefs_->GetBoolean(prefs::kDisableExtensions) ||
@@ -1291,7 +1289,7 @@ void ProfileImpl::MarkAsCleanShutdown() {
// NOTE: If you change what thread this writes on, be sure and update
// ChromeFrame::EndSession().
- prefs_->SavePersistentPrefs();
+ prefs_->CommitPendingWrite();
}
}
@@ -1533,9 +1531,6 @@ void ProfileImpl::ChangeAppLocale(
if (chromeos::UserManager::Get()->current_user_is_owner())
local_state->SetString(prefs::kOwnerLocale, new_locale);
-
- GetPrefs()->ScheduleSavePersistentPrefs();
- local_state->ScheduleSavePersistentPrefs();
}
void ProfileImpl::OnLogin() {
diff --git a/chrome/browser/search_engines/template_url_service.cc b/chrome/browser/search_engines/template_url_service.cc
index 9886e64..7585494 100644
--- a/chrome/browser/search_engines/template_url_service.cc
+++ b/chrome/browser/search_engines/template_url_service.cc
@@ -1214,8 +1214,6 @@ void TemplateURLService::SaveDefaultSearchProviderToPrefs(
prefs->SetString(prefs::kDefaultSearchProviderKeyword, keyword);
prefs->SetString(prefs::kDefaultSearchProviderID, id_string);
prefs->SetString(prefs::kDefaultSearchProviderPrepopulateID, prepopulate_id);
-
- prefs->ScheduleSavePersistentPrefs();
}
bool TemplateURLService::LoadDefaultSearchProviderFromPrefs(
diff --git a/chrome/browser/sync/signin_manager.cc b/chrome/browser/sync/signin_manager.cc
index bacdfdb..e60ede5 100644
--- a/chrome/browser/sync/signin_manager.cc
+++ b/chrome/browser/sync/signin_manager.cc
@@ -185,7 +185,6 @@ void SigninManager::SignOut() {
authenticated_username_.clear();
profile_->GetPrefs()->ClearPref(prefs::kGoogleServicesUsername);
profile_->GetPrefs()->ClearPref(prefs::kSyncUsingOAuth);
- profile_->GetPrefs()->ScheduleSavePersistentPrefs();
profile_->GetTokenService()->ResetCredentialsInMemory();
profile_->GetTokenService()->EraseTokensFromDB();
}
@@ -209,7 +208,6 @@ void SigninManager::OnGetUserInfoSuccess(const std::string& key,
profile_->GetPrefs()->SetString(prefs::kGoogleServicesUsername,
authenticated_username_);
profile_->GetPrefs()->SetBoolean(prefs::kSyncUsingOAuth, false);
- profile_->GetPrefs()->ScheduleSavePersistentPrefs();
GoogleServiceSigninSuccessDetails details(authenticated_username_,
password_);
@@ -313,7 +311,6 @@ void SigninManager::OnUserInfoSuccess(const std::string& email) {
profile_->GetPrefs()->SetString(
prefs::kGoogleServicesUsername, authenticated_username_);
profile_->GetPrefs()->SetBoolean(prefs::kSyncUsingOAuth, true);
- profile_->GetPrefs()->ScheduleSavePersistentPrefs();
DCHECK(password_.empty());
GoogleServiceSigninSuccessDetails details(authenticated_username_, "");
diff --git a/chrome/browser/sync/sync_prefs.cc b/chrome/browser/sync/sync_prefs.cc
index 867fa33..b6c7e74 100644
--- a/chrome/browser/sync/sync_prefs.cc
+++ b/chrome/browser/sync/sync_prefs.cc
@@ -53,8 +53,6 @@ void SyncPrefs::ClearPreferences() {
// e.g. prefs::kSyncBookmarks. Is that really what we want?
pref_service_->ClearPref(prefs::kSyncMaxInvalidationVersions);
-
- pref_service_->ScheduleSavePersistentPrefs();
}
bool SyncPrefs::HasSyncSetupCompleted() const {
@@ -69,7 +67,6 @@ void SyncPrefs::SetSyncSetupCompleted() {
CHECK(pref_service_);
pref_service_->SetBoolean(prefs::kSyncHasSetupCompleted, true);
SetStartSuppressed(false);
- pref_service_->ScheduleSavePersistentPrefs();
}
bool SyncPrefs::IsStartSuppressed() const {
@@ -83,7 +80,6 @@ void SyncPrefs::SetStartSuppressed(bool is_suppressed) {
DCHECK(non_thread_safe_.CalledOnValidThread());
CHECK(pref_service_);
pref_service_->SetBoolean(prefs::kSyncSuppressStart, is_suppressed);
- pref_service_->ScheduleSavePersistentPrefs();
}
std::string SyncPrefs::GetGoogleServicesUsername() const {
@@ -105,7 +101,6 @@ void SyncPrefs::SetLastSyncedTime(base::Time time) {
DCHECK(non_thread_safe_.CalledOnValidThread());
CHECK(pref_service_);
pref_service_->SetInt64(prefs::kSyncLastSyncedTime, time.ToInternalValue());
- pref_service_->ScheduleSavePersistentPrefs();
}
bool SyncPrefs::HasKeepEverythingSynced() const {
@@ -120,7 +115,6 @@ void SyncPrefs::SetKeepEverythingSynced(bool keep_everything_synced) {
CHECK(pref_service_);
pref_service_->SetBoolean(prefs::kSyncKeepEverythingSynced,
keep_everything_synced);
- pref_service_->ScheduleSavePersistentPrefs();
}
syncable::ModelTypeSet SyncPrefs::GetPreferredDataTypes(
@@ -241,7 +235,6 @@ void SyncPrefs::SetEncryptionBootstrapToken(const std::string& token) {
DCHECK(non_thread_safe_.CalledOnValidThread());
CHECK(pref_service_);
pref_service_->SetString(prefs::kSyncEncryptionBootstrapToken, token);
- pref_service_->ScheduleSavePersistentPrefs();
}
sync_notifier::InvalidationVersionMap SyncPrefs::GetAllMaxVersions() const {
@@ -326,7 +319,6 @@ void SyncPrefs::AcknowledgeSyncedTypes(
scoped_ptr<ListValue> value(
syncable::ModelTypeSetToValue(acknowledged_types));
pref_service_->Set(prefs::kSyncAcknowledgedSyncTypes, *value);
- pref_service_->ScheduleSavePersistentPrefs();
}
void SyncPrefs::Observe(int type,
@@ -354,7 +346,6 @@ void SyncPrefs::SetManagedForTest(bool is_managed) {
DCHECK(non_thread_safe_.CalledOnValidThread());
CHECK(pref_service_);
pref_service_->SetBoolean(prefs::kSyncManaged, is_managed);
- pref_service_->ScheduleSavePersistentPrefs();
}
syncable::ModelTypeSet SyncPrefs::GetAcknowledgeSyncedTypesForTest() const {
@@ -518,7 +509,6 @@ void SyncPrefs::SetDataTypePreferred(
return;
}
pref_service_->SetBoolean(pref_name, is_preferred);
- pref_service_->ScheduleSavePersistentPrefs();
}
} // namespace browser_sync
diff --git a/chrome/browser/tabs/pinned_tab_codec.cc b/chrome/browser/tabs/pinned_tab_codec.cc
index e54ea2b..2caab3b 100644
--- a/chrome/browser/tabs/pinned_tab_codec.cc
+++ b/chrome/browser/tabs/pinned_tab_codec.cc
@@ -108,7 +108,6 @@ void PinnedTabCodec::WritePinnedTabs(Profile* profile) {
}
}
prefs->Set(prefs::kPinnedTabs, values);
- prefs->ScheduleSavePersistentPrefs();
}
// static
diff --git a/chrome/browser/translate/translate_prefs.cc b/chrome/browser/translate/translate_prefs.cc
index 290340f..fb3fdaf 100644
--- a/chrome/browser/translate/translate_prefs.cc
+++ b/chrome/browser/translate/translate_prefs.cc
@@ -74,7 +74,6 @@ void TranslatePrefs::WhitelistLanguagePair(
return;
}
dict->SetString(original_language, target_language);
- prefs_->ScheduleSavePersistentPrefs();
}
void TranslatePrefs::RemoveLanguagePairFromWhitelist(
@@ -86,8 +85,7 @@ void TranslatePrefs::RemoveLanguagePairFromWhitelist(
NOTREACHED() << "Unregistered translate whitelist pref";
return;
}
- if (dict->Remove(original_language, NULL))
- prefs_->ScheduleSavePersistentPrefs();
+ dict->Remove(original_language, NULL);
}
int TranslatePrefs::GetTranslationDeniedCount(const std::string& language) {
@@ -193,13 +191,11 @@ void TranslatePrefs::MigrateTranslateWhitelists(PrefService* user_prefs) {
DictionaryValue* dict = update.Get();
if (!dict || dict->empty())
return;
- bool save_prefs = false;
for (DictionaryValue::key_iterator iter(dict->begin_keys());
iter != dict->end_keys(); ++iter) {
ListValue* list = NULL;
if (!dict->GetList(*iter, &list) || !list)
break; // Dictionary has either been migrated or new format.
- save_prefs = true;
std::string target_lang;
if (list->empty() || !list->GetString(list->GetSize() - 1, &target_lang) ||
target_lang.empty())
@@ -207,9 +203,6 @@ void TranslatePrefs::MigrateTranslateWhitelists(PrefService* user_prefs) {
else
dict->SetString(*iter, target_lang);
}
- if (!save_prefs)
- return;
- user_prefs->ScheduleSavePersistentPrefs();
}
// TranslatePrefs: private: ----------------------------------------------------
@@ -241,24 +234,18 @@ void TranslatePrefs::BlacklistValue(const char* pref_id,
}
blacklist->Append(new StringValue(value));
}
- prefs_->ScheduleSavePersistentPrefs();
}
void TranslatePrefs::RemoveValueFromBlacklist(const char* pref_id,
const std::string& value) {
- bool schedule_save = false;
- {
- ListPrefUpdate update(prefs_, pref_id);
- ListValue* blacklist = update.Get();
- if (!blacklist) {
- NOTREACHED() << "Unregistered translate blacklist pref";
- return;
- }
- StringValue string_value(value);
- schedule_save = blacklist->Remove(string_value, NULL);
+ ListPrefUpdate update(prefs_, pref_id);
+ ListValue* blacklist = update.Get();
+ if (!blacklist) {
+ NOTREACHED() << "Unregistered translate blacklist pref";
+ return;
}
- if (schedule_save)
- prefs_->ScheduleSavePersistentPrefs();
+ StringValue string_value(value);
+ blacklist->Remove(string_value, NULL);
}
bool TranslatePrefs::IsLanguageWhitelisted(
diff --git a/chrome/browser/ui/auto_login_prompter.cc b/chrome/browser/ui/auto_login_prompter.cc
index e2c6688..24c70b6 100644
--- a/chrome/browser/ui/auto_login_prompter.cc
+++ b/chrome/browser/ui/auto_login_prompter.cc
@@ -212,7 +212,6 @@ bool AutoLoginInfoBarDelegate::Accept() {
bool AutoLoginInfoBarDelegate::Cancel() {
pref_service_->SetBoolean(prefs::kAutologinEnabled, false);
- pref_service_->ScheduleSavePersistentPrefs();
return true;
}
diff --git a/chrome/browser/ui/browser.cc b/chrome/browser/ui/browser.cc
index 1f1ba7c..462b638 100644
--- a/chrome/browser/ui/browser.cc
+++ b/chrome/browser/ui/browser.cc
@@ -4707,7 +4707,6 @@ void Browser::UpdateCommandsForBookmarkBar() {
void Browser::MarkHomePageAsChanged(PrefService* pref_service) {
pref_service->SetBoolean(prefs::kHomePageChanged, true);
- pref_service->ScheduleSavePersistentPrefs();
}
void Browser::UpdateSaveAsState(int content_restrictions) {
diff --git a/chrome/browser/ui/browser_init.cc b/chrome/browser/ui/browser_init.cc
index 32a4e1d0..ffb2d72 100644
--- a/chrome/browser/ui/browser_init.cc
+++ b/chrome/browser/ui/browser_init.cc
@@ -748,7 +748,6 @@ bool BrowserInit::WasRestarted() {
PrefService* pref_service = g_browser_process->local_state();
was_restarted = pref_service->GetBoolean(prefs::kWasRestarted);
pref_service->SetBoolean(prefs::kWasRestarted, false);
- pref_service->ScheduleSavePersistentPrefs();
was_restarted_read = true;
}
return was_restarted;
diff --git a/chrome/browser/ui/browser_list.cc b/chrome/browser/ui/browser_list.cc
index e6cac26..481cb0f 100644
--- a/chrome/browser/ui/browser_list.cc
+++ b/chrome/browser/ui/browser_list.cc
@@ -494,7 +494,7 @@ void BrowserList::AttemptUserExit() {
state->GetString(prefs::kApplicationLocale) != owner_locale &&
!state->IsManagedPreference(prefs::kApplicationLocale)) {
state->SetString(prefs::kApplicationLocale, owner_locale);
- state->SavePersistentPrefs();
+ state->CommitPendingWrite();
}
}
g_session_manager_requested_shutdown = false;
@@ -520,7 +520,6 @@ void BrowserList::AttemptRestart() {
PrefService* pref_service = g_browser_process->local_state();
pref_service->SetBoolean(prefs::kWasRestarted, true);
- pref_service->ScheduleSavePersistentPrefs();
#if defined(OS_CHROMEOS)
// For CrOS instead of browser restart (which is not supported) perform a full
diff --git a/chrome/browser/ui/webui/options/core_options_handler.cc b/chrome/browser/ui/webui/options/core_options_handler.cc
index c3ff607..bceaa5f 100644
--- a/chrome/browser/ui/webui/options/core_options_handler.cc
+++ b/chrome/browser/ui/webui/options/core_options_handler.cc
@@ -208,8 +208,6 @@ void CoreOptionsHandler::SetPref(const std::string& pref_name,
return;
}
- pref_service->ScheduleSavePersistentPrefs();
-
ProcessUserMetric(value, metric);
}
@@ -217,7 +215,6 @@ void CoreOptionsHandler::ClearPref(const std::string& pref_name,
const std::string& metric) {
PrefService* pref_service = Profile::FromWebUI(web_ui_)->GetPrefs();
pref_service->ClearPref(pref_name.c_str());
- pref_service->ScheduleSavePersistentPrefs();
if (!metric.empty())
content::RecordComputedAction(metric);
diff --git a/chrome/browser/ui/webui/options2/core_options_handler2.cc b/chrome/browser/ui/webui/options2/core_options_handler2.cc
index 6158ebb..9e0fc25 100644
--- a/chrome/browser/ui/webui/options2/core_options_handler2.cc
+++ b/chrome/browser/ui/webui/options2/core_options_handler2.cc
@@ -210,8 +210,6 @@ void CoreOptionsHandler::SetPref(const std::string& pref_name,
return;
}
- pref_service->ScheduleSavePersistentPrefs();
-
ProcessUserMetric(value, metric);
}
@@ -219,7 +217,6 @@ void CoreOptionsHandler::ClearPref(const std::string& pref_name,
const std::string& metric) {
PrefService* pref_service = Profile::FromWebUI(web_ui_)->GetPrefs();
pref_service->ClearPref(pref_name.c_str());
- pref_service->ScheduleSavePersistentPrefs();
if (!metric.empty())
content::RecordComputedAction(metric);
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;
};
diff --git a/chrome/service/service_process_prefs.cc b/chrome/service/service_process_prefs.cc
index 8eb2962..511709a 100644
--- a/chrome/service/service_process_prefs.cc
+++ b/chrome/service/service_process_prefs.cc
@@ -19,7 +19,7 @@ void ServiceProcessPrefs::ReadPrefs() {
}
void ServiceProcessPrefs::WritePrefs() {
- prefs_->WritePrefs();
+ prefs_->CommitPendingWrite();
}
void ServiceProcessPrefs::GetString(const std::string& key,