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

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

Issue 825773003: PasswordStore: Use ScopedVector to express ownership of forms (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use assignment instead of construction Created 5 years, 11 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/login_database.cc
diff --git a/components/password_manager/core/browser/login_database.cc b/components/password_manager/core/browser/login_database.cc
index c70e650e02c8934162be96747ecf76bdd54f4142..011344a9fca15380df33c461ddee1f58f797997f 100644
--- a/components/password_manager/core/browser/login_database.cc
+++ b/components/password_manager/core/browser/login_database.cc
@@ -683,8 +683,9 @@ LoginDatabase::EncryptionResult LoginDatabase::InitPasswordFormFromStatement(
return ENCRYPTION_RESULT_SUCCESS;
}
-bool LoginDatabase::GetLogins(const PasswordForm& form,
- std::vector<PasswordForm*>* forms) const {
+bool LoginDatabase::GetLogins(
+ const PasswordForm& form,
+ ScopedVector<autofill::PasswordForm>* forms) const {
DCHECK(forms);
// You *must* change LoginTableColumns if this query changes.
const std::string sql_query =
@@ -781,7 +782,7 @@ bool LoginDatabase::GetLogins(const PasswordForm& form,
bool LoginDatabase::GetLoginsCreatedBetween(
const base::Time begin,
const base::Time end,
- std::vector<autofill::PasswordForm*>* forms) const {
+ ScopedVector<autofill::PasswordForm>* forms) const {
DCHECK(forms);
sql::Statement s(db_.GetCachedStatement(
SQL_FROM_HERE,
@@ -814,7 +815,7 @@ bool LoginDatabase::GetLoginsCreatedBetween(
bool LoginDatabase::GetLoginsSyncedBetween(
const base::Time begin,
const base::Time end,
- std::vector<autofill::PasswordForm*>* forms) const {
+ ScopedVector<autofill::PasswordForm>* forms) const {
DCHECK(forms);
sql::Statement s(db_.GetCachedStatement(
SQL_FROM_HERE,
@@ -845,18 +846,18 @@ bool LoginDatabase::GetLoginsSyncedBetween(
}
bool LoginDatabase::GetAutofillableLogins(
- std::vector<PasswordForm*>* forms) const {
+ ScopedVector<autofill::PasswordForm>* forms) const {
return GetAllLoginsWithBlacklistSetting(false, forms);
}
bool LoginDatabase::GetBlacklistLogins(
- std::vector<PasswordForm*>* forms) const {
+ ScopedVector<autofill::PasswordForm>* forms) const {
return GetAllLoginsWithBlacklistSetting(true, forms);
}
bool LoginDatabase::GetAllLoginsWithBlacklistSetting(
bool blacklisted,
- std::vector<PasswordForm*>* forms) const {
+ ScopedVector<autofill::PasswordForm>* forms) const {
DCHECK(forms);
// You *must* change LoginTableColumns if this query changes.
sql::Statement s(db_.GetCachedStatement(

Powered by Google App Engine
This is Rietveld 408576698