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

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

Issue 2587313002: FormFetcherImpl: MakeWeakCopies no longer a template (Closed)
Patch Set: resize -> constructor Created 4 years 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 | « no previous file | 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/form_fetcher_impl.cc
diff --git a/components/password_manager/core/browser/form_fetcher_impl.cc b/components/password_manager/core/browser/form_fetcher_impl.cc
index 493e44edf8b2cbd1a487b8c5012ba03b5506b021..72b71b710187d8c014e5f34e337ca224d0747e96 100644
--- a/components/password_manager/core/browser/form_fetcher_impl.cc
+++ b/components/password_manager/core/browser/form_fetcher_impl.cc
@@ -45,14 +45,14 @@ std::vector<std::unique_ptr<PasswordForm>> SplitFederatedMatches(
return federated_matches;
}
-// Create a vector of const T* from a vector of unique_ptr<T>.
-template <typename T>
-std::vector<const T*> MakeWeakCopies(
- const std::vector<std::unique_ptr<T>>& owning) {
- std::vector<const T*> result;
- result.resize(owning.size());
- std::transform(owning.begin(), owning.end(), result.begin(),
- [](const std::unique_ptr<T>& ptr) { return ptr.get(); });
+// Create a vector of const PasswordForm from a vector of
+// unique_ptr<PasswordForm> by applying get() item-wise.
+std::vector<const PasswordForm*> MakeWeakCopies(
+ const std::vector<std::unique_ptr<PasswordForm>>& owning) {
+ std::vector<const PasswordForm*> result(owning.size());
+ std::transform(
+ owning.begin(), owning.end(), result.begin(),
+ [](const std::unique_ptr<PasswordForm>& ptr) { return ptr.get(); });
return result;
}
@@ -80,13 +80,13 @@ const std::vector<InteractionsStats>& FormFetcherImpl::GetInteractionsStats()
return interactions_stats_;
}
-const std::vector<const autofill::PasswordForm*>&
-FormFetcherImpl::GetFederatedMatches() const {
+const std::vector<const PasswordForm*>& FormFetcherImpl::GetFederatedMatches()
+ const {
return weak_federated_;
}
void FormFetcherImpl::OnGetPasswordStoreResults(
- std::vector<std::unique_ptr<autofill::PasswordForm>> results) {
+ std::vector<std::unique_ptr<PasswordForm>> results) {
DCHECK_EQ(State::WAITING, state_);
state_ = State::NOT_WAITING;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698