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

Unified Diff: chrome/renderer/autofill/form_cache.cc

Issue 9225042: Fix Autofill hang when interacting with large forms (i.e. forms containing many fields). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix test failure -- don't count hidden fields Created 8 years, 11 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
« no previous file with comments | « chrome/renderer/autofill/form_autofill_util.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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)
« no previous file with comments | « chrome/renderer/autofill/form_autofill_util.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698