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

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

Issue 2078253002: vector<unique_ptr> for PasswordFormManager::blacklisted_matches_ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix UI controller Created 4 years, 6 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
« no previous file with comments | « components/password_manager/core/browser/password_form_manager.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/password_manager/core/browser/password_form_manager.cc
diff --git a/components/password_manager/core/browser/password_form_manager.cc b/components/password_manager/core/browser/password_form_manager.cc
index 934f291a2f90d203890ea0e43dde18b26c0f722a..51d3e2ee38ff1c2ae7df6c8278d2cdde55ab3292 100644
--- a/components/password_manager/core/browser/password_form_manager.cc
+++ b/components/password_manager/core/browser/password_form_manager.cc
@@ -277,7 +277,8 @@ void PasswordFormManager::PermanentlyBlacklist() {
DCHECK(!client_->IsOffTheRecord());
// Configure the form about to be saved for blacklist status.
- blacklisted_matches_.push_back(new autofill::PasswordForm(observed_form_));
+ blacklisted_matches_.push_back(
+ base::WrapUnique(new autofill::PasswordForm(observed_form_)));
blacklisted_matches_.back()->preferred = false;
blacklisted_matches_.back()->blacklisted_by_user = true;
blacklisted_matches_.back()->other_possible_usernames.clear();
@@ -461,7 +462,7 @@ void PasswordFormManager::OnRequestDone(
[](PasswordForm* form) { return !form->blacklisted_by_user; });
for (auto it = begin_blacklisted; it != logins_result.end(); ++it) {
if (IsBlacklistMatch(**it)) {
- blacklisted_matches_.push_back(*it);
+ blacklisted_matches_.push_back(base::WrapUnique(*it));
*it = nullptr;
}
}
« no previous file with comments | « components/password_manager/core/browser/password_form_manager.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698