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

Unified Diff: components/autofill/core/common/password_form.h

Issue 1096983002: Update usages of std::map to use ScopedPtrMap. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@passwordmanager-scopedmemory
Patch Set: Fix Mac compile. Created 5 years, 6 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/autofill/core/common/password_form.h
diff --git a/components/autofill/core/common/password_form.h b/components/autofill/core/common/password_form.h
index 96633264b01e32a407cdf3e9d150ee763faad6f0..f246e73f7ad833dbc5ac2c68263a68e8caee5a84 100644
--- a/components/autofill/core/common/password_form.h
+++ b/components/autofill/core/common/password_form.h
@@ -9,6 +9,8 @@
#include <string>
#include <vector>
+#include "base/containers/scoped_ptr_map.h"
+#include "base/memory/scoped_ptr.h"
#include "base/time/time.h"
#include "components/autofill/core/common/form_data.h"
#include "url/gurl.h"
@@ -280,8 +282,9 @@ struct PasswordForm {
};
// Map username to PasswordForm* for convenience. See password_form_manager.h.
-typedef std::map<base::string16, PasswordForm*> PasswordFormMap;
+typedef ScopedPtrMap<base::string16, scoped_ptr<PasswordForm>> PasswordFormMap;
+// Like PasswordFormMap, but with weak (not owned) pointers.
typedef std::map<base::string16, const PasswordForm*> ConstPasswordFormMap;
// For testing.

Powered by Google App Engine
This is Rietveld 408576698