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

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

Issue 2900693002: [Password Manager] Convert |pending_login_managers_| to an array of scoped_refptr (Closed)
Patch Set: Rebase Created 3 years, 7 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/password_form_manager.h
diff --git a/components/password_manager/core/browser/password_form_manager.h b/components/password_manager/core/browser/password_form_manager.h
index 2bc3bb26ab82321cbdfe765e1524f1a9e4ff1157..932fb67c234695ad6f966cd6ad55a8f2056785e5 100644
--- a/components/password_manager/core/browser/password_form_manager.h
+++ b/components/password_manager/core/browser/password_form_manager.h
@@ -13,6 +13,7 @@
#include <vector>
#include "base/macros.h"
+#include "base/memory/ref_counted.h"
#include "base/memory/weak_ptr.h"
#include "base/optional.h"
#include "base/strings/string16.h"
@@ -38,7 +39,8 @@ using FieldTypeMap = std::map<base::string16, autofill::ServerFieldType>;
// This class helps with filling the observed form (both HTML and from HTTP
// auth) and with saving/updating the stored information about it.
-class PasswordFormManager : public FormFetcher::Consumer {
+class PasswordFormManager : public FormFetcher::Consumer,
+ public base::RefCounted<PasswordFormManager> {
public:
// |password_manager| owns |this|, |client| and |driver| serve to
// communicate with embedder, |observed_form| is the associated form |this|
@@ -56,7 +58,6 @@ class PasswordFormManager : public FormFetcher::Consumer {
const autofill::PasswordForm& observed_form,
std::unique_ptr<FormSaver> form_saver,
FormFetcher* form_fetcher);
- ~PasswordFormManager() override;
// Flags describing the result of comparing two forms as performed by
// DoesMatch. Individual flags are only relevant for HTML forms, but
@@ -255,12 +256,16 @@ class PasswordFormManager : public FormFetcher::Consumer {
void GrabFetcher(std::unique_ptr<FormFetcher> fetcher);
protected:
+ ~PasswordFormManager() override;
+
// FormFetcher::Consumer:
void ProcessMatches(
const std::vector<const autofill::PasswordForm*>& non_federated,
size_t filtered_count) override;
private:
+ friend class base::RefCounted<PasswordFormManager>;
+
// ManagerAction - What does the manager do with this form? Either it
// fills it, or it doesn't. If it doesn't fill it, that's either
// because it has no match or it is disabled via the AUTOCOMPLETE=off

Powered by Google App Engine
This is Rietveld 408576698