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

Unified Diff: components/password_manager/core/browser/statistics_table.cc

Issue 2262843002: Make PasswordFormManager::best_matches_ const (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@621355_pass_creds_to_update_by_value
Patch Set: Just rebased Created 4 years, 4 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/password_manager/core/browser/statistics_table.cc
diff --git a/components/password_manager/core/browser/statistics_table.cc b/components/password_manager/core/browser/statistics_table.cc
index 23522a9a8db766e2a801ec9634b63099251caeab..bc174f021f3326f5b19afcc29805eb32cca5064a 100644
--- a/components/password_manager/core/browser/statistics_table.cc
+++ b/components/password_manager/core/browser/statistics_table.cc
@@ -35,15 +35,14 @@ bool operator==(const InteractionsStats& lhs, const InteractionsStats& rhs) {
lhs.update_time == rhs.update_time;
}
-InteractionsStats* FindStatsByUsername(
- const std::vector<std::unique_ptr<InteractionsStats>>& stats,
+const InteractionsStats* FindStatsByUsername(
+ const std::vector<const InteractionsStats*>& stats,
const base::string16& username) {
- auto it = std::find_if(
- stats.begin(), stats.end(),
- [&username](const std::unique_ptr<InteractionsStats>& element) {
- return username == element->username_value;
- });
- return it == stats.end() ? nullptr : it->get();
+ auto it = std::find_if(stats.begin(), stats.end(),
+ [&username](const InteractionsStats* element) {
+ return username == element->username_value;
+ });
+ return it == stats.end() ? nullptr : *it;
}
StatisticsTable::StatisticsTable() : db_(nullptr) {

Powered by Google App Engine
This is Rietveld 408576698