Index: components/sync_driver/about_sync_util.cc |
diff --git a/components/sync_driver/about_sync_util.cc b/components/sync_driver/about_sync_util.cc |
index 457728fd8a7d2d13f5a7ca033e17481beb7b8eee..f1ae5a805a5196604917a2eb89c2af3f3630ea55 100644 |
--- a/components/sync_driver/about_sync_util.cc |
+++ b/components/sync_driver/about_sync_util.cc |
@@ -5,6 +5,7 @@ |
#include "components/sync_driver/about_sync_util.h" |
#include <string> |
+#include <utility> |
#include "base/location.h" |
#include "base/strings/string16.h" |
@@ -70,12 +71,12 @@ namespace { |
// |parent_list|, not the caller, owns the newly added section. |
base::ListValue* AddSection(base::ListValue* parent_list, |
const std::string& title) { |
- base::DictionaryValue* section = new base::DictionaryValue(); |
+ std::unique_ptr<base::DictionaryValue> section(new base::DictionaryValue()); |
base::ListValue* section_contents = new base::ListValue(); |
section->SetString("title", title); |
section->Set("data", section_contents); |
section->SetBoolean("is_sensitive", false); |
- parent_list->Append(section); |
+ parent_list->Append(std::move(section)); |
return section_contents; |
} |
@@ -83,12 +84,12 @@ base::ListValue* AddSection(base::ListValue* parent_list, |
// form and posted in a public forum (e.g. unique identifiers). |
base::ListValue* AddSensitiveSection(base::ListValue* parent_list, |
const std::string& title) { |
- base::DictionaryValue* section = new base::DictionaryValue(); |
+ std::unique_ptr<base::DictionaryValue> section(new base::DictionaryValue()); |
base::ListValue* section_contents = new base::ListValue(); |
section->SetString("title", title); |
section->Set("data", section_contents); |
section->SetBoolean("is_sensitive", true); |
- parent_list->Append(section); |
+ parent_list->Append(std::move(section)); |
return section_contents; |
} |