[autofill] Support consolidated uploads for a field.

This CL changes the uploaded autofilltype (i.e. vote) field to be repeating instead of a single required field per uploaded field.

Background: The autofill upload proto has a repeated "Field" attribute that has a single required autofilltype field. Autofill can send multiple votes for a given field (if a field matches the users full address as well as address line 1, for example). Prior to this CL, clients would send multiple "Field" entries (repeating all attached metadata) in the event of multiple votes. Clients also send multiple "Field" entries if there are fields having the same signature (address line 1,2, sharing the same field name/id, for example, is not uncommon). The recipient of these votes is not able to tell these 2 cases apart (multiple votes for a single field vs votes for multiple fields with the same signature).

With this CL, clients will upload exactly one "Field" entry per logical field in the form. In this way all type votes for a field will be consolsidated to a single Field entry. It will also consolidate (instead of repeating) any additional metadata send about the field into that single entry for the field.

Bug: 850606
Change-Id: I73acea17f755b6ebe37f11c9e72e02f9bf1c5484
Reviewed-on: https://chromium-review.googlesource.com/1142485
Commit-Queue: Roger McFarlane <rogerm@chromium.org>
Reviewed-by: Sebastien Seguin-Gagnon <sebsg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#582158}
5 files changed