Commit d4a9b6f4 authored by vabr's avatar vabr Committed by Commit bot

PasswordAutofillAgent: avoid NULL frames in provisionally_saved_forms_

This should stop the NULL dereference reported in the bug referenced below. It only targets the symptom, not the cause, though. The proper fix will hopefully come with a planned refactoring as referenced in the code comment.

BUG=420519
TBR=isherman@chromium.org

Review URL: https://codereview.chromium.org/666503002

Cr-Commit-Position: refs/heads/master@{#300143}
parent 04a35bf0
......@@ -1217,7 +1217,14 @@ void PasswordAutofillAgent::ProvisionallySavePassword(
blink::WebLocalFrame* frame,
const blink::WebFormElement& form,
ProvisionallySaveRestriction restriction) {
DCHECK(frame);
// TODO(vabr): This is just to stop getting a NULL frame in
// |provisionally_saved_forms_|. Cases where we try to save password for a
// form in a NULL frame should not happen, and it's currently unclear how they
// happen (http://crbug.com/420519). This thing will be hopefully solved by
// migrating the PasswordAutofillAgent to observe frames directly
// (http://crbug.com/400186).
if (!frame)
return;
scoped_ptr<PasswordForm> password_form(CreatePasswordForm(form));
if (!password_form || (restriction == RESTRICTION_NON_EMPTY_PASSWORD &&
password_form->password_value.empty() &&
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment