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

Unified Diff: components/autofill/core/browser/autofill_merge_unittest.cc

Issue 2403773002: Remove stl_util's STLDeleteContainerPointers from autofill. (Closed)
Patch Set: rebase Created 4 years, 2 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: components/autofill/core/browser/autofill_merge_unittest.cc
diff --git a/components/autofill/core/browser/autofill_merge_unittest.cc b/components/autofill/core/browser/autofill_merge_unittest.cc
index dfa93142527c1beb8c0671749aad8b99e208bc94..2229f9046ce5668a6adb3aa6dd40072a17873e7a 100644
--- a/components/autofill/core/browser/autofill_merge_unittest.cc
+++ b/components/autofill/core/browser/autofill_merge_unittest.cc
@@ -12,6 +12,7 @@
#include "base/files/file_enumerator.h"
#include "base/files/file_path.h"
#include "base/macros.h"
+#include "base/memory/ptr_util.h"
#include "base/path_service.h"
#include "base/strings/string_split.h"
#include "base/strings/string_util.h"
@@ -119,10 +120,10 @@ class PersonalDataManagerMock : public PersonalDataManager {
// PersonalDataManager:
std::string SaveImportedProfile(const AutofillProfile& profile) override;
- const std::vector<AutofillProfile*>& web_profiles() const override;
+ std::vector<AutofillProfile*> web_profiles() const override;
private:
- ScopedVector<AutofillProfile> profiles_;
+ std::vector<std::unique_ptr<AutofillProfile>> profiles_;
DISALLOW_COPY_AND_ASSIGN(PersonalDataManagerMock);
};
@@ -142,15 +143,17 @@ std::string PersonalDataManagerMock::SaveImportedProfile(
const AutofillProfile& profile) {
std::vector<AutofillProfile> profiles;
std::string merged_guid =
- MergeProfile(profile, profiles_.get(), "en-US", &profiles);
+ MergeProfile(profile, &profiles_, "en-US", &profiles);
if (merged_guid == profile.guid())
- profiles_.push_back(new AutofillProfile(profile));
+ profiles_.push_back(base::MakeUnique<AutofillProfile>(profile));
return merged_guid;
}
-const std::vector<AutofillProfile*>& PersonalDataManagerMock::web_profiles()
- const {
- return profiles_.get();
+std::vector<AutofillProfile*> PersonalDataManagerMock::web_profiles() const {
+ std::vector<AutofillProfile*> result;
+ for (const auto& profile : profiles_)
+ result.push_back(profile.get());
+ return result;
}
} // namespace

Powered by Google App Engine
This is Rietveld 408576698