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

Side by Side Diff: components/autofill/core/browser/autofill_manager.cc

Issue 115733009: [Autofill] Bail on corrupt AutofillHostMsg_ShowPasswordSuggestions message (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/autofill_manager.h" 5 #include "components/autofill/core/browser/autofill_manager.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <limits> 9 #include <limits>
10 #include <map> 10 #include <map>
(...skipping 591 matching lines...) Expand 10 before | Expand all | Expand 10 after
602 const FormFieldData& form, 602 const FormFieldData& form,
603 const PasswordFormFillData& fill_data) { 603 const PasswordFormFillData& fill_data) {
604 external_delegate_->AddPasswordFormMapping(form, fill_data); 604 external_delegate_->AddPasswordFormMapping(form, fill_data);
605 } 605 }
606 606
607 void AutofillManager::OnShowPasswordSuggestions( 607 void AutofillManager::OnShowPasswordSuggestions(
608 const FormFieldData& field, 608 const FormFieldData& field,
609 const gfx::RectF& bounds, 609 const gfx::RectF& bounds,
610 const std::vector<base::string16>& suggestions, 610 const std::vector<base::string16>& suggestions,
611 const std::vector<base::string16>& realms) { 611 const std::vector<base::string16>& realms) {
612 // Bail if the IPC message is corrupt.
613 if (suggestions.size() != realms.size())
palmer 2013/12/20 00:08:08 Does it also make sense to set some minimum and/or
Ilya Sherman 2013/12/20 00:15:00 Hmm, we already check this in the renderer, so I g
614 return;
615
612 external_delegate_->OnShowPasswordSuggestions(suggestions, 616 external_delegate_->OnShowPasswordSuggestions(suggestions,
613 realms, 617 realms,
614 field, 618 field,
615 bounds); 619 bounds);
616 } 620 }
617 621
618 void AutofillManager::OnSetDataList(const std::vector<base::string16>& values, 622 void AutofillManager::OnSetDataList(const std::vector<base::string16>& values,
619 const std::vector<base::string16>& labels) { 623 const std::vector<base::string16>& labels) {
624 // Bail if the IPC message is corrupt.
620 if (values.size() != labels.size()) 625 if (values.size() != labels.size())
621 return; 626 return;
622 627
623 external_delegate_->SetCurrentDataListValues(values, labels); 628 external_delegate_->SetCurrentDataListValues(values, labels);
624 } 629 }
625 630
626 void AutofillManager::OnLoadedServerPredictions( 631 void AutofillManager::OnLoadedServerPredictions(
627 const std::string& response_xml) { 632 const std::string& response_xml) {
628 // Parse and store the server predictions. 633 // Parse and store the server predictions.
629 FormStructure::ParseQueryResponse(response_xml, 634 FormStructure::ParseQueryResponse(response_xml,
(...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after
1100 return false; 1105 return false;
1101 1106
1102 // Disregard forms that we wouldn't ever autofill in the first place. 1107 // Disregard forms that we wouldn't ever autofill in the first place.
1103 if (!form.ShouldBeParsed(true)) 1108 if (!form.ShouldBeParsed(true))
1104 return false; 1109 return false;
1105 1110
1106 return true; 1111 return true;
1107 } 1112 }
1108 1113
1109 } // namespace autofill 1114 } // namespace autofill
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698