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 728a18d8cf9198de8de16c419e381df354b6bb18..193beddbdace687af8f577521916b45e572f8fc5 100644 |
--- a/components/password_manager/core/browser/password_form_manager.h |
+++ b/components/password_manager/core/browser/password_form_manager.h |
@@ -5,6 +5,7 @@ |
#ifndef COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_PASSWORD_FORM_MANAGER_H_ |
#define COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_PASSWORD_FORM_MANAGER_H_ |
+#include <base/memory/ref_counted.h> |
vasilii
2017/05/29 13:15:48
Should go down
kolos1
2017/05/29 15:47:06
Done.
|
#include <stdint.h> |
#include <map> |
@@ -26,6 +27,7 @@ |
using autofill::FormData; |
using autofill::FormStructure; |
+using base::RefCounted; |
vasilii
2017/05/29 13:15:48
Seems mostly not used.
kolos1
2017/05/29 15:47:06
Removed.
|
namespace password_manager { |
@@ -38,7 +40,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 RefCounted<PasswordFormManager> { |
public: |
// |password_manager| owns |this|, |client| and |driver| serve to |
// communicate with embedder, |observed_form| is the associated form |this| |
@@ -56,7 +59,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 +257,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>; |
vasilii
2017/05/29 13:15:48
What is the point in making a base class friend?
kolos1
2017/05/29 15:47:06
It is required for using RefCounted (https://cs.ch
|
+ |
// 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 |