Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(36)

Unified Diff: ios/chrome/browser/autofill/autofill_agent.mm

Issue 2884933002: Remove raw base::DictionaryValue::SetWithoutPathExpansion (Closed)
Patch Set: Include Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..9f2e38ce68b885379cc81e1059b2ea4c521dd6d8 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"
@@ -860,8 +862,7 @@ void GetFormAndField(autofill::FormData* form,
(const std::vector<autofill::FormStructure*>&)structure {
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 +872,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);
« no previous file with comments | « extensions/browser/api/bluetooth_low_energy/utils.cc ('k') | ios/chrome/browser/browser_state/browser_state_info_cache.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698