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

Unified Diff: chrome/browser/password_manager/native_backend_kwallet_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: 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: chrome/browser/password_manager/native_backend_kwallet_x.h
diff --git a/chrome/browser/password_manager/native_backend_kwallet_x.h b/chrome/browser/password_manager/native_backend_kwallet_x.h
index 725600c67d4a15f61925dd7f57e43b709462771e..2ed7aabce70202a752a58bd8e3a6e6add7c7976e 100644
--- a/chrome/browser/password_manager/native_backend_kwallet_x.h
+++ b/chrome/browser/password_manager/native_backend_kwallet_x.h
@@ -9,6 +9,7 @@
#include "base/basictypes.h"
#include "base/memory/ref_counted.h"
+#include "base/memory/scoped_vector.h"
#include "base/time/time.h"
#include "chrome/browser/password_manager/password_store_factory.h"
#include "chrome/browser/password_manager/password_store_x.h"
@@ -54,9 +55,10 @@ class NativeBackendKWallet : public PasswordStoreX::NativeBackend {
base::Time delete_end,
password_manager::PasswordStoreChangeList* changes) override;
bool GetLogins(const autofill::PasswordForm& form,
- PasswordFormList* forms) override;
- bool GetAutofillableLogins(PasswordFormList* forms) override;
- bool GetBlacklistLogins(PasswordFormList* forms) override;
+ ScopedVector<autofill::PasswordForm>* forms) override;
+ bool GetAutofillableLogins(
+ ScopedVector<autofill::PasswordForm>* forms) override;
+ bool GetBlacklistLogins(ScopedVector<autofill::PasswordForm>* forms) override;
protected:
// Invalid handle returned by WalletHandle().
@@ -68,7 +70,7 @@ class NativeBackendKWallet : public PasswordStoreX::NativeBackend {
// Deserializes a list of PasswordForms from the wallet.
static void DeserializeValue(const std::string& signon_realm,
const Pickle& pickle,
- PasswordFormList* forms);
+ ScopedVector<autofill::PasswordForm>* forms);
private:
enum InitResult {
@@ -90,22 +92,23 @@ class NativeBackendKWallet : public PasswordStoreX::NativeBackend {
bool* success);
// Reads PasswordForms from the wallet that match the given signon_realm.
- bool GetLoginsList(PasswordFormList* forms,
- const std::string& signon_realm,
- int wallet_handle);
+ bool GetLoginsList(const std::string& signon_realm,
+ int wallet_handle,
+ ScopedVector<autofill::PasswordForm>* forms);
// Reads PasswordForms from the wallet with the given autofillability state.
- bool GetLoginsList(PasswordFormList* forms,
- bool autofillable,
- int wallet_handle);
+ bool GetLoginsList(bool autofillable,
+ int wallet_handle,
+ ScopedVector<autofill::PasswordForm>* forms);
// Helper for some of the above GetLoginsList() methods.
- bool GetAllLogins(PasswordFormList* forms, int wallet_handle);
+ bool GetAllLogins(int wallet_handle,
+ ScopedVector<autofill::PasswordForm>* forms);
// Writes a list of PasswordForms to the wallet with the given signon_realm.
// Overwrites any existing list for this signon_realm. Removes the entry if
// |forms| is empty. Returns true on success.
- bool SetLoginsList(const PasswordFormList& forms,
+ bool SetLoginsList(const std::vector<autofill::PasswordForm*>& forms,
const std::string& signon_realm,
int wallet_handle);
@@ -121,7 +124,8 @@ class NativeBackendKWallet : public PasswordStoreX::NativeBackend {
int WalletHandle();
// Serializes a list of PasswordForms to be stored in the wallet.
- static void SerializeValue(const PasswordFormList& forms, Pickle* pickle);
+ static void SerializeValue(const std::vector<autofill::PasswordForm*>& forms,
+ Pickle* pickle);
// Deserializes a list of PasswordForms from the wallet.
// |size_32| controls reading the size field within the pickle as 32 bits.
@@ -131,8 +135,10 @@ class NativeBackendKWallet : public PasswordStoreX::NativeBackend {
// when reading old pickles that fail to deserialize using the native size.
static bool DeserializeValueSize(const std::string& signon_realm,
const PickleIterator& iter,
- int version, bool size_32, bool warn_only,
- PasswordFormList* forms);
+ int version,
+ bool size_32,
+ bool warn_only,
+ ScopedVector<autofill::PasswordForm>* forms);
// In case the fields in the pickle ever change, version them so we can try to
// read old pickles. (Note: do not eat old pickles past the expiration date.)

Powered by Google App Engine
This is Rietveld 408576698