Use Value::Take...() in /chrome/browser/autofill
Refactor to use the new base::Value
TakeString/TakeDict/TakeList methods that transfer ownership
in a clearer way and allow clang-tidy catch misuses.
This CL was uploaded by git cl split.
R=schwering@google.com
Bug: 1360570
Change-Id: I1b09fda2c7d1cc9d81540d2bc3f36e83b705a522
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3913066
Auto-Submit: Maksim Ivanov <emaxx@chromium.org>
Reviewed-by: Christoph Schwering <schwering@google.com>
Commit-Queue: Christoph Schwering <schwering@google.com>
Cr-Commit-Position: refs/heads/main@{#1051041}
diff --git a/chrome/browser/autofill/captured_sites_test_utils.cc b/chrome/browser/autofill/captured_sites_test_utils.cc
index 83fca27..059cea0 100644
--- a/chrome/browser/autofill/captured_sites_test_utils.cc
+++ b/chrome/browser/autofill/captured_sites_test_utils.cc
@@ -980,7 +980,7 @@
}
DCHECK(parsed_json->is_dict());
- base::Value::Dict recipe = std::move(parsed_json->GetDict());
+ base::Value::Dict recipe = std::move(*parsed_json).TakeDict();
if (!InitializeBrowserToExecuteRecipe(recipe))
return false;
@@ -1136,7 +1136,7 @@
}
if (!SetupSavedAutofillProfile(
- std::move(autofill_profile_container->GetList()))) {
+ std::move(*autofill_profile_container).TakeList())) {
return false;
}
}
@@ -1150,7 +1150,7 @@
return false;
}
- if (!SetupSavedPasswords(std::move(saved_password_container->GetList()))) {
+ if (!SetupSavedPasswords(std::move(*saved_password_container).TakeList())) {
return false;
}
}
@@ -2229,7 +2229,7 @@
return false;
}
- const base::Value::Dict list_entry_dict = std::move(list_entry.GetDict());
+ const base::Value::Dict list_entry_dict = std::move(list_entry).TakeDict();
absl::optional<std::string> type =
FindPopulateString(list_entry_dict, "type", "profile field type");
absl::optional<std::string> value =