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

Unified Diff: chrome/browser/extensions/extension_prefs.cc

Issue 8198007: Remove PrefService::ScheduleSavePersistentPrefs and SavePersistentPrefs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix Created 9 years 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/browser/extensions/extension_prefs.cc
diff --git a/chrome/browser/extensions/extension_prefs.cc b/chrome/browser/extensions/extension_prefs.cc
index c70e26815dd4b53d7e7d6c29e0911b001e326e33..493ba5ad34f03309d56d991058e41323605a86e9 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(
« no previous file with comments | « chrome/browser/extensions/extension_prefs.h ('k') | chrome/browser/extensions/extension_service_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698