Commit d49a7750 authored by Hajime Hoshi's avatar Hajime Hoshi Committed by Commit Bot

Reland: Fix a leak of a document that is held by AutofillAgent

This CL is just relanding https://chromium-review.googlesource.com/c/chromium/src/+/597482,
after confirming that there are no statistical significant regressions
in the real world by Finch experiments (crbug.com/755489).

Note that this might still cause Telemetry regressions reported at
crbug.com/753071 before, but this is expected.

A document is leaked because AutofillAgent hold a lastly used element
even after navigation happens, and the document of the element remains
until a new (input) element is focused. This CL fixes this issue by
resetting the element in AutofillAgent when navigation happens.

Bug: 734427, 755489
Change-Id: Ie3ee7f202abf56e22102e3d7f68cf2778f85ca87
Reviewed-on: https://chromium-review.googlesource.com/908371
Commit-Queue: Hajime Hoshi <hajimehoshi@chromium.org>
Reviewed-by: default avatarKouhei Ueno <kouhei@chromium.org>
Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Reviewed-by: default avatarEvan Stade <estade@chromium.org>
Cr-Commit-Position: refs/heads/master@{#539105}
parent d5f1046c
...@@ -192,16 +192,7 @@ void AutofillAgent::DidCommitProvisionalLoad(bool is_new_navigation, ...@@ -192,16 +192,7 @@ void AutofillAgent::DidCommitProvisionalLoad(bool is_new_navigation,
return; return;
// Navigation to a new page or a page refresh. // Navigation to a new page or a page refresh.
element_.Reset();
// Do Finch testing to see how much regressions are caused by this leak fix
// (crbug/753071).
std::string group_name =
base::FieldTrialList::FindFullName("FixDocumentLeakInAutofillAgent");
if (base::StartsWith(group_name, "enabled",
base::CompareCase::INSENSITIVE_ASCII)) {
element_.Reset();
}
form_cache_.Reset(); form_cache_.Reset();
ResetLastInteractedElements(); ResetLastInteractedElements();
OnFormNoLongerSubmittable(); OnFormNoLongerSubmittable();
......
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