Index: ios/chrome/browser/autofill/autofill_agent.mm |
diff --git a/ios/chrome/browser/autofill/autofill_agent.mm b/ios/chrome/browser/autofill/autofill_agent.mm |
index 9f2e38ce68b885379cc81e1059b2ea4c521dd6d8..39435727925f35d7f6255f15a1c12068e3ba2825 100644 |
--- a/ios/chrome/browser/autofill/autofill_agent.mm |
+++ b/ios/chrome/browser/autofill/autofill_agent.mm |
@@ -810,14 +810,14 @@ void GetFormAndField(autofill::FormData* form, |
formData->SetString("formName", base::UTF16ToUTF8(form.name)); |
// Note: Destruction of all child base::Value types is handled by the root |
// formData object on its own destruction. |
- base::DictionaryValue* fieldsData = new base::DictionaryValue; |
+ auto fieldsData = base::MakeUnique<base::DictionaryValue>(); |
const std::vector<autofill::FormFieldData>& fields = form.fields; |
for (const auto& fieldData : fields) { |
fieldsData->SetStringWithoutPathExpansion(base::UTF16ToUTF8(fieldData.name), |
fieldData.value); |
} |
- formData->Set("fields", fieldsData); |
+ formData->Set("fields", std::move(fieldsData)); |
// Stringify the JSON data and send it to the UIWebView-side fillForm method. |
std::string dataString; |