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

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

Issue 2774653006: Refactor Password Manager to use base::EraseIf (Closed)
Patch Set: Created 3 years, 9 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/obsolete_http_cleaner.cc
diff --git a/components/password_manager/core/browser/obsolete_http_cleaner.cc b/components/password_manager/core/browser/obsolete_http_cleaner.cc
index 06536ddccf849566dee382f4d4863c71172b22f4..cdbe4f2d402e6a3accd593c6ba904f1bd9130df2 100644
--- a/components/password_manager/core/browser/obsolete_http_cleaner.cc
+++ b/components/password_manager/core/browser/obsolete_http_cleaner.cc
@@ -10,6 +10,7 @@
#include "base/logging.h"
#include "base/memory/ref_counted.h"
+#include "base/stl_util.h"
#include "components/autofill/core/common/password_form.h"
#include "components/password_manager/core/browser/password_manager_client.h"
#include "components/password_manager/core/browser/password_store.h"
@@ -58,11 +59,9 @@ ObsoleteHttpCleaner::~ObsoleteHttpCleaner() = default;
void ObsoleteHttpCleaner::OnGetPasswordStoreResults(
std::vector<std::unique_ptr<PasswordForm>> results) {
// Non HTTP or HTTPS credentials are ignored.
- results.erase(std::remove_if(std::begin(results), std::end(results),
- [](const std::unique_ptr<PasswordForm>& form) {
- return !form->origin.SchemeIsHTTPOrHTTPS();
- }),
- std::end(results));
+ base::EraseIf(results, [](const std::unique_ptr<PasswordForm>& form) {
+ return !form->origin.SchemeIsHTTPOrHTTPS();
+ });
// Move HTTPS forms into their own container.
auto https_forms = SplitFormsFrom(

Powered by Google App Engine
This is Rietveld 408576698