| 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 c2ad965a43069d72f8e21666d6ec9814802820f9..f1c48d2f68a46a51d2ec199bda48a6cb18cfea36 100644
|
| --- a/components/password_manager/core/browser/login_database.h
|
| +++ b/components/password_manager/core/browser/login_database.h
|
| @@ -67,13 +67,15 @@ class LoginDatabase {
|
| bool RemoveLoginsSyncedBetween(base::Time delete_begin,
|
| base::Time delete_end);
|
|
|
| - // 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.
|
| + // All Get* methods below overwrite |forms| with the returned credentials. On
|
| + // success, those methods return true, on failure they return false and clear
|
| + // |forms|.
|
| +
|
| + // Get a list of credentials matching |form|, including blacklisted matches.
|
| bool GetLogins(const autofill::PasswordForm& form,
|
| ScopedVector<autofill::PasswordForm>* forms) const;
|
|
|
| - // Loads all logins created from |begin| onwards (inclusive) and before |end|.
|
| + // Get 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.
|
| bool GetLoginsCreatedBetween(
|
| @@ -81,7 +83,7 @@ class LoginDatabase {
|
| base::Time end,
|
| ScopedVector<autofill::PasswordForm>* forms) const;
|
|
|
| - // Loads all logins synced from |begin| onwards (inclusive) and before |end|.
|
| + // Get 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.
|
| bool GetLoginsSyncedBetween(
|
| @@ -89,11 +91,10 @@ class LoginDatabase {
|
| base::Time end,
|
| ScopedVector<autofill::PasswordForm>* forms) const;
|
|
|
| - // Loads the complete list of autofillable password forms (i.e., not blacklist
|
| - // entries) into |forms|.
|
| + // Get the complete list of not blacklisted credentials.
|
| bool GetAutofillableLogins(ScopedVector<autofill::PasswordForm>* forms) const;
|
|
|
| - // Loads the complete list of blacklist forms into |forms|.
|
| + // Get the complete list of blacklisted credentials.
|
| bool GetBlacklistLogins(ScopedVector<autofill::PasswordForm>* forms) const;
|
|
|
| // Deletes the login database file on disk, and creates a new, empty database.
|
| @@ -122,15 +123,15 @@ class LoginDatabase {
|
| // successful, or returning false and leaving cipher_text unchanged if
|
| // encryption fails (e.g., if the underlying OS encryption system is
|
| // temporarily unavailable).
|
| - EncryptionResult EncryptedString(const base::string16& plain_text,
|
| - std::string* cipher_text) const;
|
| + static EncryptionResult EncryptedString(const base::string16& plain_text,
|
| + std::string* cipher_text);
|
|
|
| // Decrypts cipher_text, setting the value of plain_text and returning true if
|
| // successful, or returning false and leaving plain_text unchanged if
|
| // decryption fails (e.g., if the underlying OS encryption system is
|
| // temporarily unavailable).
|
| - EncryptionResult DecryptedString(const std::string& cipher_text,
|
| - base::string16* plain_text) const;
|
| + static EncryptionResult DecryptedString(const std::string& cipher_text,
|
| + base::string16* plain_text);
|
|
|
| bool InitLoginsTable();
|
| bool MigrateOldVersionsAsNeeded();
|
| @@ -139,15 +140,25 @@ class LoginDatabase {
|
| // be of the form used by the Get*Logins methods).
|
| // Returns the EncryptionResult from decrypting the password in |s|; if not
|
| // ENCRYPTION_RESULT_SUCCESS, |form| is not filled.
|
| - EncryptionResult InitPasswordFormFromStatement(autofill::PasswordForm* form,
|
| - sql::Statement& s) const;
|
| + static EncryptionResult InitPasswordFormFromStatement(
|
| + autofill::PasswordForm* form,
|
| + sql::Statement& s);
|
|
|
| - // Loads all logins whose blacklist setting matches |blacklisted| into
|
| - // |forms|.
|
| + // Gets all blacklisted or all non-blacklisted (depending on |blacklisted|)
|
| + // credentials. On success returns true and overwrites |forms| with the
|
| + // result, otherwise returns false and clears |forms|.
|
| bool GetAllLoginsWithBlacklistSetting(
|
| bool blacklisted,
|
| ScopedVector<autofill::PasswordForm>* forms) const;
|
|
|
| + // Overwrites |forms| with credentials retrieved from |statement|. If
|
| + // |psl_match| is not null, filters out all results but thos PSL-matching
|
| + // |*psl_match|. On success returns true, otherwise clears |forms| and returns
|
| + // false.
|
| + static bool StatementToForms(sql::Statement* statement,
|
| + const autofill::PasswordForm* psl_match,
|
| + ScopedVector<autofill::PasswordForm>* forms);
|
| +
|
| base::FilePath db_path_;
|
| mutable sql::Connection db_;
|
| sql::MetaTable meta_table_;
|
|
|