| Index: base/prefs/json_pref_store.cc
|
| diff --git a/base/prefs/json_pref_store.cc b/base/prefs/json_pref_store.cc
|
| index 04479753c3aad7b98e41370d09133d746e415d83..169e300595e9c3937add3e865f6e2f15b33208e7 100644
|
| --- a/base/prefs/json_pref_store.cc
|
| +++ b/base/prefs/json_pref_store.cc
|
| @@ -218,14 +218,10 @@ void JsonPrefStore::SetValueSilently(const std::string& key, Value* value) {
|
| }
|
|
|
| void JsonPrefStore::RemoveValue(const std::string& key) {
|
| - if (prefs_->Remove(key, NULL))
|
| + if (prefs_->RemovePath(key, NULL))
|
| ReportValueChanged(key);
|
| }
|
|
|
| -void JsonPrefStore::MarkNeedsEmptyValue(const std::string& key) {
|
| - keys_need_empty_value_.insert(key);
|
| -}
|
| -
|
| bool JsonPrefStore::ReadOnly() const {
|
| return read_only_;
|
| }
|
| @@ -328,30 +324,5 @@ bool JsonPrefStore::SerializeData(std::string* output) {
|
| // value?
|
| JSONStringValueSerializer serializer(output);
|
| serializer.set_pretty_print(true);
|
| - scoped_ptr<DictionaryValue> copy(prefs_->DeepCopyWithoutEmptyChildren());
|
| -
|
| - // Iterates |keys_need_empty_value_| and if the key exists in |prefs_|,
|
| - // ensure its empty ListValue or DictonaryValue is preserved.
|
| - for (std::set<std::string>::const_iterator
|
| - it = keys_need_empty_value_.begin();
|
| - it != keys_need_empty_value_.end();
|
| - ++it) {
|
| - const std::string& key = *it;
|
| -
|
| - base::Value* value = NULL;
|
| - if (!prefs_->Get(key, &value))
|
| - continue;
|
| -
|
| - if (value->IsType(base::Value::TYPE_LIST)) {
|
| - const base::ListValue* list = NULL;
|
| - if (value->GetAsList(&list) && list->empty())
|
| - copy->Set(key, new base::ListValue);
|
| - } else if (value->IsType(base::Value::TYPE_DICTIONARY)) {
|
| - const base::DictionaryValue* dict = NULL;
|
| - if (value->GetAsDictionary(&dict) && dict->empty())
|
| - copy->Set(key, new base::DictionaryValue);
|
| - }
|
| - }
|
| -
|
| - return serializer.Serialize(*(copy.get()));
|
| + return serializer.Serialize(*prefs_);
|
| }
|
|
|