Commit b9881f64 authored by Christoph Schwering's avatar Christoph Schwering Committed by Chromium LUCI CQ

[Autofill] Removed language change from sufficient conditions for cache update.

The condition had been weakened in crrev.com/c/2550785 to the effect
that the cached form is updated when the language has become available
or changed since the seen was form last. This uncovered a bug in the
sectioning.

Especially since we may have an alternative way of receiving the
language in crrev.com/c/2561838, the sectioning bug outweighs the
benefit of the cache update.

This CL is essentially a revert of crrev.com/c/2550785.

Bug: 1154080
Change-Id: If70e8c4806ec2215c5a9f7c342789b7d53925656
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2566752Reviewed-by: default avatarMatthias Körber <koerber@google.com>
Commit-Queue: Christoph Schwering <schwering@google.com>
Cr-Commit-Position: refs/heads/master@{#832325}
parent 85e8fd9e
......@@ -43,11 +43,7 @@ AutofillField* FindAutofillFillField(const FormStructure& form,
// Returns true if |live_form| does not match |cached_form|, assuming that
// |live_form|'s language is |live_form_language|.
bool CachedFormNeedsUpdate(const FormData& live_form,
const LanguageCode& live_form_language,
const FormStructure& cached_form) {
if (cached_form.current_page_language() != live_form_language)
return true;
if (live_form.fields.size() != cached_form.field_count())
return true;
......@@ -215,7 +211,7 @@ bool AutofillHandler::GetCachedFormAndField(const FormData& form,
FindCachedFormByRendererId(form.unique_renderer_id);
if (cached_form) {
DCHECK(cached_form);
if (!CachedFormNeedsUpdate(form, GetPageLanguage(), *cached_form)) {
if (!CachedFormNeedsUpdate(form, *cached_form)) {
// There is no data to return if there are no auto-fillable fields.
if (!cached_form->autofill_count())
return false;
......
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