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

Unified Diff: base/prefs/pref_service.cc

Issue 81183005: Remove JsonPrefStore pruning of empty values on write. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 1 month 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: base/prefs/pref_service.cc
diff --git a/base/prefs/pref_service.cc b/base/prefs/pref_service.cc
index 4c707a50d6c231137055bf27b7930f945aa3045e..f02abc02c27c9cd1bb75916f4b0f1f05a93a0638 100644
--- a/base/prefs/pref_service.cc
+++ b/base/prefs/pref_service.cc
@@ -297,10 +297,6 @@ const base::Value* PrefService::GetDefaultPrefValue(const char* path) const {
return value;
}
-void PrefService::MarkUserStoreNeedsEmptyValue(const std::string& key) const {
- user_pref_store_->MarkNeedsEmptyValue(key);
-}
-
const base::ListValue* PrefService::GetList(const char* path) const {
DCHECK(CalledOnValidThread());
@@ -349,23 +345,7 @@ void PrefService::AddRegisteredPreference(const char* path,
base::Value* default_value) {
DCHECK(CalledOnValidThread());
- // For ListValue and DictionaryValue with non empty default, empty value
- // for |path| needs to be persisted in |user_pref_store_|. So that
- // non empty default is not used when user sets an empty ListValue or
- // DictionaryValue.
- bool needs_empty_value = false;
- base::Value::Type orig_type = default_value->GetType();
- if (orig_type == base::Value::TYPE_LIST) {
- const base::ListValue* list = NULL;
- if (default_value->GetAsList(&list) && !list->empty())
- needs_empty_value = true;
- } else if (orig_type == base::Value::TYPE_DICTIONARY) {
- const base::DictionaryValue* dict = NULL;
- if (default_value->GetAsDictionary(&dict) && !dict->empty())
- needs_empty_value = true;
- }
- if (needs_empty_value)
- user_pref_store_->MarkNeedsEmptyValue(path);
+ //REMOVE?
Mattias Nissler (ping if slow) 2013/11/22 08:03:38 Yes, as well as PrefService::AddInitialPreferences
gab 2013/11/22 23:24:21 Hmmm interesting that I didn't get a PRESUBMIT che
}
void PrefService::ClearPref(const char* path) {

Powered by Google App Engine
This is Rietveld 408576698