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

Unified Diff: chrome/renderer/autofill/form_autofill_util.h

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
Index: chrome/renderer/autofill/form_autofill_util.h
diff --git a/chrome/renderer/autofill/form_autofill_util.h b/chrome/renderer/autofill/form_autofill_util.h
index 69b819c7537005dc2affd91e83dc0840f0d57ea9..4b5c3622d62e17aea8db3956c0860cb8635f763e 100644
--- a/chrome/renderer/autofill/form_autofill_util.h
+++ b/chrome/renderer/autofill/form_autofill_util.h
@@ -44,6 +44,13 @@ enum ExtractMask {
// WebFormControlElement.
};
+// 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.
+extern const size_t kMaxParseableFields;
+
// Returns true if |element| is a text input element.
bool IsTextInput(const WebKit::WebInputElement* element);
@@ -73,8 +80,8 @@ void WebFormControlElementToFormField(
// corresponding to the |form_control_element|.
// |extract_mask| controls what data is extracted.
// Returns true if |form| is filled out; it's possible that the |form_element|
-// won't meet the |requirements|. Also returns false if there are no fields
-// in the |form|.
+// won't meet the |requirements|. Also returns false if there are no fields or
+// too many fields in the |form|.
bool WebFormElementToFormData(
const WebKit::WebFormElement& form_element,
const WebKit::WebFormControlElement& form_control_element,
@@ -85,7 +92,7 @@ bool WebFormElementToFormData(
// Finds the form that contains |element| and returns it in |form|. Fills
// |field| with the |FormField| representation for element.
-// Returns false if the form is not found.
+// Returns false if the form is not found or cannot be serialized.
bool FindFormAndFieldForInputElement(const WebKit::WebInputElement& element,
webkit::forms::FormData* form,
webkit::forms::FormField* field,
« no previous file with comments | « chrome/renderer/autofill/form_autofill_browsertest.cc ('k') | chrome/renderer/autofill/form_autofill_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698