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

Unified Diff: components/autofill/content/renderer/form_autofill_util.cc

Issue 1946143002: Destroy (Password)AutofillAgent safely (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Also setChecked Created 4 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/autofill/content/renderer/form_autofill_util.cc
diff --git a/components/autofill/content/renderer/form_autofill_util.cc b/components/autofill/content/renderer/form_autofill_util.cc
index cb7947514250d5bbe3f689711c7590b9da959a29..139b0e3e3dc38bdf61fc371f19972b1ea1a157b4 100644
--- a/components/autofill/content/renderer/form_autofill_util.cc
+++ b/components/autofill/content/renderer/form_autofill_util.cc
@@ -893,6 +893,10 @@ void FillFormField(const FormFieldData& data,
}
field->setValue(value, true);
}
+ // Setting the form might trigger JavaScript, which is capable of
+ // destroying the frame.
+ if (!field->document().frame())
+ return;
field->setAutofilled(true);
« no previous file with comments | « components/autofill/content/renderer/autofill_agent.cc ('k') | components/autofill/content/renderer/password_autofill_agent.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698