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

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

Issue 786823002: PasswordFormManager takes WeakPtr<PasswordManagerDriver> (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed test compilation Created 6 years 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_manager_driver.h
diff --git a/components/password_manager/core/browser/password_manager_driver.h b/components/password_manager/core/browser/password_manager_driver.h
index 5f7bd7a43d1980dade690f2dc89b98b1588a3447..515cebab32a7a82de1c8aa5d05f87dfc0cf2a14a 100644
--- a/components/password_manager/core/browser/password_manager_driver.h
+++ b/components/password_manager/core/browser/password_manager_driver.h
@@ -8,6 +8,7 @@
#include <vector>
#include "base/macros.h"
+#include "base/memory/weak_ptr.h"
#include "base/strings/string16.h"
namespace autofill {
@@ -27,8 +28,8 @@ class PasswordManager;
// (i.e., obtain information from it and give information to it).
class PasswordManagerDriver {
public:
- PasswordManagerDriver() {}
- virtual ~PasswordManagerDriver() {}
+ PasswordManagerDriver();
+ virtual ~PasswordManagerDriver();
// Fills forms matching |form_data|.
virtual void FillPasswordForm(
@@ -63,7 +64,12 @@ class PasswordManagerDriver {
// Returns the PasswordAutofillManager associated with this instance.
virtual PasswordAutofillManager* GetPasswordAutofillManager() = 0;
+ // Returns a weak pointer to |this|.
+ base::WeakPtr<PasswordManagerDriver> GetWeakPtr();
Evan Stade 2014/12/08 20:02:50 is there a reason not to use SupportsWeakPtr/AsWea
vabr (Chromium) 2014/12/09 12:55:46 Done. Thanks for pointing this out. There is not r
+
private:
+ base::WeakPtrFactory<PasswordManagerDriver> weak_ptr_factory_;
+
DISALLOW_COPY_AND_ASSIGN(PasswordManagerDriver);
};

Powered by Google App Engine
This is Rietveld 408576698