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

Unified Diff: chrome/browser/password_manager/password_store_x.h

Issue 825773003: PasswordStore: Use ScopedVector to express ownership of forms (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix one more use-after-free 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: chrome/browser/password_manager/password_store_x.h
diff --git a/chrome/browser/password_manager/password_store_x.h b/chrome/browser/password_manager/password_store_x.h
index 2907e0b7da4cd757d03f16335614ebbf24e8022c..28fad0686b7a63b2c0e5c5bf04897286c381068b 100644
--- a/chrome/browser/password_manager/password_store_x.h
+++ b/chrome/browser/password_manager/password_store_x.h
@@ -8,6 +8,7 @@
#include <vector>
#include "base/memory/scoped_ptr.h"
+#include "base/memory/scoped_vector.h"
#include "base/time/time.h"
#include "components/password_manager/core/browser/password_store_default.h"
@@ -34,8 +35,6 @@ class PasswordStoreX : public password_manager::PasswordStoreDefault {
// with return values rather than implicit consumer notification.
class NativeBackend {
public:
- typedef std::vector<autofill::PasswordForm*> PasswordFormList;
-
virtual ~NativeBackend() {}
virtual bool Init() = 0;
@@ -60,9 +59,11 @@ class PasswordStoreX : public password_manager::PasswordStoreDefault {
password_manager::PasswordStoreChangeList* changes) = 0;
virtual bool GetLogins(const autofill::PasswordForm& form,
- PasswordFormList* forms) = 0;
- virtual bool GetAutofillableLogins(PasswordFormList* forms) = 0;
- virtual bool GetBlacklistLogins(PasswordFormList* forms) = 0;
+ ScopedVector<autofill::PasswordForm>* forms) = 0;
+ virtual bool GetAutofillableLogins(
+ ScopedVector<autofill::PasswordForm>* forms) = 0;
+ virtual bool GetBlacklistLogins(
+ ScopedVector<autofill::PasswordForm>* forms) = 0;
};
// Takes ownership of |login_db| and |backend|. |backend| may be NULL in which
@@ -96,12 +97,12 @@ class PasswordStoreX : public password_manager::PasswordStoreDefault {
void GetAutofillableLoginsImpl(GetLoginsRequest* request) override;
void GetBlacklistLoginsImpl(GetLoginsRequest* request) override;
bool FillAutofillableLogins(
- std::vector<autofill::PasswordForm*>* forms) override;
+ ScopedVector<autofill::PasswordForm>* forms) override;
bool FillBlacklistLogins(
- std::vector<autofill::PasswordForm*>* forms) override;
+ ScopedVector<autofill::PasswordForm>* forms) override;
// Sort logins by origin, like the ORDER BY clause in login_database.cc.
- void SortLoginsByOrigin(NativeBackend::PasswordFormList* list);
+ void SortLoginsByOrigin(std::vector<autofill::PasswordForm*>* list);
// Check to see whether migration is necessary, and perform it if so.
void CheckMigration();

Powered by Google App Engine
This is Rietveld 408576698