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 fa8ffb63081afcbadf263a6f9a475215029c260e..4a283809e36b0ede66e33fd2a70cbda685080a90 100644 |
--- a/ios/chrome/browser/autofill/autofill_agent.mm |
+++ b/ios/chrome/browser/autofill/autofill_agent.mm |
@@ -6,6 +6,7 @@ |
#include <memory> |
#include <string> |
+#include <utility> |
#include "base/format_macros.h" |
#include "base/guid.h" |
@@ -13,6 +14,7 @@ |
#include "base/json/json_writer.h" |
#include "base/mac/foundation_util.h" |
#include "base/mac/scoped_block.h" |
+#include "base/memory/ptr_util.h" |
#include "base/metrics/field_trial.h" |
#include "base/strings/string16.h" |
#include "base/strings/sys_string_conversions.h" |
@@ -861,7 +863,7 @@ void GetFormAndField(autofill::FormData* form, |
base::DictionaryValue predictionData; |
for (autofill::FormStructure* form : structure) { |
// |predictionData| will take ownership below. |
- base::DictionaryValue* formJSONData = new base::DictionaryValue; |
+ auto formJSONData = base::MakeUnique<base::DictionaryValue>(); |
autofill::FormData formData = form->ToFormData(); |
for (const auto& field : *form) { |
autofill::AutofillType type(field->Type()); |
@@ -871,7 +873,7 @@ void GetFormAndField(autofill::FormData* form, |
base::UTF16ToUTF8(field->name), type.ToString()); |
} |
predictionData.SetWithoutPathExpansion(base::UTF16ToUTF8(formData.name), |
- formJSONData); |
+ std::move(formJSONData)); |
} |
std::string dataString; |
base::JSONWriter::Write(predictionData, &dataString); |