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

Unified Diff: components/autofill/content/renderer/password_autofill_agent.h

Issue 686653003: Don't use FormFieldData only as a key in a map (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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/content/renderer/password_autofill_agent.h
diff --git a/components/autofill/content/renderer/password_autofill_agent.h b/components/autofill/content/renderer/password_autofill_agent.h
index df43c3d09476aa35bcd5e9af0eb4b7d8c87a7122..99f2a94567338cd656bc1e13727d9af50ae56f3a 100644
--- a/components/autofill/content/renderer/password_autofill_agent.h
+++ b/components/autofill/content/renderer/password_autofill_agent.h
@@ -98,6 +98,7 @@ class PasswordAutofillAgent : public content::RenderViewObserver {
PasswordInfo();
};
typedef std::map<blink::WebElement, PasswordInfo> LoginToPasswordInfoMap;
+ typedef std::map<blink::WebElement, int> LoginToPasswordInfoKeyMap;
typedef std::map<blink::WebElement, blink::WebElement> PasswordToLoginMap;
typedef std::map<blink::WebFrame*,
linked_ptr<PasswordForm> > FrameToPasswordFormMap;
@@ -146,7 +147,7 @@ class PasswordAutofillAgent : public content::RenderViewObserver {
const blink::WebFormElement& form) override;
// RenderView IPC handlers:
- void OnFillPasswordForm(const PasswordFormFillData& form_data);
+ void OnFillPasswordForm(int key, const PasswordFormFillData& form_data);
void OnSetLoggingState(bool active);
// Scans the given frame for password forms and sends them up to the browser.
@@ -191,6 +192,8 @@ class PasswordAutofillAgent : public content::RenderViewObserver {
// The logins we have filled so far with their associated info.
LoginToPasswordInfoMap login_to_password_info_;
+ // And the keys under which PasswordAutofillManager can find the same info.
+ LoginToPasswordInfoKeyMap login_to_password_info_key_;
// A (sort-of) reverse map to |login_to_password_info_|.
PasswordToLoginMap password_to_username_;

Powered by Google App Engine
This is Rietveld 408576698