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

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

Issue 825773003: PasswordStore: Use ScopedVector to express ownership of forms (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Leaks fixed + VABR->vabr 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.h
diff --git a/components/password_manager/core/browser/login_database.h b/components/password_manager/core/browser/login_database.h
index c3e83cff9cec7bd34ac6a1a65bfd29dcfaf9e620..d47ff27b5472c6a0ce9e31765d0e328eba176b3e 100644
--- a/components/password_manager/core/browser/login_database.h
+++ b/components/password_manager/core/browser/login_database.h
@@ -9,8 +9,10 @@
#include <vector>
#include "base/files/file_path.h"
+#include "base/memory/scoped_vector.h"
#include "base/pickle.h"
#include "base/strings/string16.h"
+#include "components/password_manager/core/browser/password_store.h"
#include "components/password_manager/core/browser/password_store_change.h"
#include "components/password_manager/core/browser/psl_matching_helper.h"
#include "sql/connection.h"
@@ -65,33 +67,32 @@ class LoginDatabase {
// Loads a list of matching password forms into the specified vector |forms|.
// The list will contain all possibly relevant entries to the observed |form|,
- // including blacklisted matches. The caller owns |forms| after the call.
+ // including blacklisted matches.
bool GetLogins(const autofill::PasswordForm& form,
- std::vector<autofill::PasswordForm*>* forms) const;
+ ScopedVector<autofill::PasswordForm>* forms) const;
// Loads all logins created from |begin| onwards (inclusive) and before |end|.
// You may use a null Time value to do an unbounded search in either
- // direction. The caller owns |forms| after the call.
+ // direction.
bool GetLoginsCreatedBetween(
base::Time begin,
base::Time end,
- std::vector<autofill::PasswordForm*>* forms) const;
+ ScopedVector<autofill::PasswordForm>* forms) const;
// Loads all logins synced from |begin| onwards (inclusive) and before |end|.
// You may use a null Time value to do an unbounded search in either
- // direction. The caller owns |forms| after the call.
+ // direction.
bool GetLoginsSyncedBetween(
base::Time begin,
base::Time end,
- std::vector<autofill::PasswordForm*>* forms) const;
+ ScopedVector<autofill::PasswordForm>* forms) const;
// Loads the complete list of autofillable password forms (i.e., not blacklist
- // entries) into |forms|. The caller owns |forms| after the call.
- bool GetAutofillableLogins(std::vector<autofill::PasswordForm*>* forms) const;
+ // entries) into |forms|.
+ bool GetAutofillableLogins(ScopedVector<autofill::PasswordForm>* forms) const;
- // Loads the complete list of blacklist forms into |forms|. The caller owns
- // |forms| after the call.
- bool GetBlacklistLogins(std::vector<autofill::PasswordForm*>* forms) const;
+ // Loads the complete list of blacklist forms into |forms|.
+ bool GetBlacklistLogins(ScopedVector<autofill::PasswordForm>* forms) const;
// Deletes the login database file on disk, and creates a new, empty database.
// This can be used after migrating passwords to some other store, to ensure
@@ -143,7 +144,7 @@ class LoginDatabase {
// |forms|.
bool GetAllLoginsWithBlacklistSetting(
bool blacklisted,
- std::vector<autofill::PasswordForm*>* forms) const;
+ ScopedVector<autofill::PasswordForm>* forms) const;
base::FilePath db_path_;
mutable sql::Connection db_;

Powered by Google App Engine
This is Rietveld 408576698