| Index: chrome/browser/extensions/extension_management_test_util.cc
|
| diff --git a/chrome/browser/extensions/extension_management_test_util.cc b/chrome/browser/extensions/extension_management_test_util.cc
|
| index ec6313ca916d14c57f6661b86e9a15b1e3e3c9fc..7733efe66cbd162a0b2c8823ca5f232bb38ab5bc 100644
|
| --- a/chrome/browser/extensions/extension_management_test_util.cc
|
| +++ b/chrome/browser/extensions/extension_management_test_util.cc
|
| @@ -49,7 +49,7 @@ void ExtensionManagementPrefUpdaterBase::UnsetPerExtensionSettings(
|
| void ExtensionManagementPrefUpdaterBase::ClearPerExtensionSettings(
|
| const ExtensionId& id) {
|
| DCHECK(crx_file::id_util::IdIsValid(id));
|
| - pref_->SetWithoutPathExpansion(id, new base::DictionaryValue());
|
| + pref_->SetWithoutPathExpansion(id, base::MakeUnique<base::DictionaryValue>());
|
| }
|
|
|
| // Helper functions for 'installation_mode' manipulation -----------------------
|
| @@ -222,18 +222,20 @@ ExtensionManagementPrefUpdaterBase::TakePref() {
|
| }
|
|
|
| void ExtensionManagementPrefUpdaterBase::ClearList(const std::string& path) {
|
| - pref_->Set(path, new base::ListValue());
|
| + pref_->Set(path, base::MakeUnique<base::ListValue>());
|
| }
|
|
|
| void ExtensionManagementPrefUpdaterBase::AddStringToList(
|
| const std::string& path,
|
| const std::string& str) {
|
| - base::ListValue* list_value = nullptr;
|
| - if (!pref_->GetList(path, &list_value)) {
|
| - list_value = new base::ListValue();
|
| - pref_->Set(path, list_value);
|
| + base::ListValue* list_value_weak = nullptr;
|
| + if (!pref_->GetList(path, &list_value_weak)) {
|
| + auto list_value = base::MakeUnique<base::ListValue>();
|
| + list_value_weak = list_value.get();
|
| + pref_->Set(path, std::move(list_value));
|
| }
|
| - CHECK(list_value->AppendIfNotPresent(base::MakeUnique<base::Value>(str)));
|
| + CHECK(
|
| + list_value_weak->AppendIfNotPresent(base::MakeUnique<base::Value>(str)));
|
| }
|
|
|
| void ExtensionManagementPrefUpdaterBase::RemoveStringFromList(
|
|
|