OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "components/autofill/core/browser/form_structure.h" | 5 #include "components/autofill/core/browser/form_structure.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <map> | 10 #include <map> |
(...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
425 AutofillQueryContents* query) { | 425 AutofillQueryContents* query) { |
426 DCHECK(encoded_signatures); | 426 DCHECK(encoded_signatures); |
427 encoded_signatures->clear(); | 427 encoded_signatures->clear(); |
428 encoded_signatures->reserve(forms.size()); | 428 encoded_signatures->reserve(forms.size()); |
429 | 429 |
430 query->set_client_version(kClientVersion); | 430 query->set_client_version(kClientVersion); |
431 | 431 |
432 // Some badly formatted web sites repeat forms - detect that and encode only | 432 // Some badly formatted web sites repeat forms - detect that and encode only |
433 // one form as returned data would be the same for all the repeated forms. | 433 // one form as returned data would be the same for all the repeated forms. |
434 std::set<std::string> processed_forms; | 434 std::set<std::string> processed_forms; |
435 for (const auto& form : forms) { | 435 for (const auto* form : forms) { |
436 std::string signature(form->FormSignature()); | 436 std::string signature(form->FormSignature()); |
437 if (processed_forms.find(signature) != processed_forms.end()) | 437 if (processed_forms.find(signature) != processed_forms.end()) |
438 continue; | 438 continue; |
439 processed_forms.insert(signature); | 439 processed_forms.insert(signature); |
440 if (form->IsMalformed()) | 440 if (form->IsMalformed()) |
441 continue; | 441 continue; |
442 | 442 |
443 form->EncodeFormForQuery(query->add_form()); | 443 form->EncodeFormForQuery(query->add_form()); |
444 | 444 |
445 encoded_signatures->push_back(signature); | 445 encoded_signatures->push_back(signature); |
(...skipping 903 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1349 filtered_strings[0].at(prefix_len)) { | 1349 filtered_strings[0].at(prefix_len)) { |
1350 // Mismatch found. | 1350 // Mismatch found. |
1351 return filtered_strings[i].substr(0, prefix_len); | 1351 return filtered_strings[i].substr(0, prefix_len); |
1352 } | 1352 } |
1353 } | 1353 } |
1354 } | 1354 } |
1355 return filtered_strings[0]; | 1355 return filtered_strings[0]; |
1356 } | 1356 } |
1357 | 1357 |
1358 } // namespace autofill | 1358 } // namespace autofill |
OLD | NEW |