| Index: chrome/renderer/autofill/form_cache.cc
|
| diff --git a/chrome/renderer/autofill/form_cache.cc b/chrome/renderer/autofill/form_cache.cc
|
| index 94912103ddf063fee1b4e2e4197072945be0730f..7db683839075e58e7120c387415a3281f7a03bcd 100644
|
| --- a/chrome/renderer/autofill/form_cache.cc
|
| +++ b/chrome/renderer/autofill/form_cache.cc
|
| @@ -41,13 +41,6 @@ namespace {
|
| // it's not necessary.
|
| const size_t kRequiredAutofillFields = 3;
|
|
|
| -// The maximum number of form fields we are willing to parse, due to
|
| -// computational costs. Several examples of forms with lots of fields that are
|
| -// not relevant to Autofill: (1) the Netflix queue; (2) the Amazon wishlist;
|
| -// (3) router configuration pages; and (4) other configuration pages, e.g. for
|
| -// Google code project settings.
|
| -const size_t kMaxParseableFields = 100;
|
| -
|
| } // namespace
|
|
|
| namespace autofill {
|
| @@ -92,15 +85,17 @@ void FormCache::ExtractForms(const WebFrame& frame,
|
| }
|
| }
|
|
|
| - // To avoid overly expensive computation, we impose both a minimum and a
|
| - // maximum number of allowable fields.
|
| - if (control_elements.size() < kRequiredAutofillFields ||
|
| - control_elements.size() > kMaxParseableFields)
|
| + // To avoid overly expensive computation, we impose a minimum number of
|
| + // allowable fields. The corresponding maximum number of allowable fields
|
| + // is imposed by WebFormElementToFormData().
|
| + if (control_elements.size() < kRequiredAutofillFields)
|
| continue;
|
|
|
| FormData form;
|
| - WebFormElementToFormData(form_element, WebFormControlElement(),
|
| - REQUIRE_NONE, EXTRACT_VALUE, &form, NULL);
|
| + if (!WebFormElementToFormData(form_element, WebFormControlElement(),
|
| + REQUIRE_NONE, EXTRACT_VALUE, &form, NULL)) {
|
| + continue;
|
| + }
|
|
|
| num_fields_seen += form.fields.size();
|
| if (num_fields_seen > kMaxParseableFields)
|
|
|