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

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

Issue 1825273002: Add more out of line copy ctors for complex classes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/field_candidates.h" 5 #include "components/autofill/core/browser/field_candidates.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
11 11
12 namespace autofill { 12 namespace autofill {
13 13
14 FieldCandidate::FieldCandidate(ServerFieldType field_type, float field_score) 14 FieldCandidate::FieldCandidate(ServerFieldType field_type, float field_score)
15 : type(field_type), score(field_score) {} 15 : type(field_type), score(field_score) {}
16 16
17 FieldCandidates::FieldCandidates() {} 17 FieldCandidates::FieldCandidates() {}
18 18
19 FieldCandidates::FieldCandidates(const FieldCandidates& other) = default;
20
19 FieldCandidates::~FieldCandidates() {} 21 FieldCandidates::~FieldCandidates() {}
20 22
21 void FieldCandidates::AddFieldCandidate(ServerFieldType type, float score) { 23 void FieldCandidates::AddFieldCandidate(ServerFieldType type, float score) {
22 field_candidates_.emplace_back(type, score); 24 field_candidates_.emplace_back(type, score);
23 } 25 }
24 26
25 // We currently select the type with the biggest sum. 27 // We currently select the type with the biggest sum.
26 ServerFieldType FieldCandidates::BestHeuristicType() const { 28 ServerFieldType FieldCandidates::BestHeuristicType() const {
27 if (field_candidates_.empty()) 29 if (field_candidates_.empty())
28 return UNKNOWN_TYPE; 30 return UNKNOWN_TYPE;
(...skipping 12 matching lines...) Expand all
41 const size_t index = std::distance(type_scores.begin(), best_type_iter); 43 const size_t index = std::distance(type_scores.begin(), best_type_iter);
42 44
43 return static_cast<ServerFieldType>(index); 45 return static_cast<ServerFieldType>(index);
44 } 46 }
45 47
46 const std::vector<FieldCandidate>& FieldCandidates::field_candidates() const { 48 const std::vector<FieldCandidate>& FieldCandidates::field_candidates() const {
47 return field_candidates_; 49 return field_candidates_;
48 } 50 }
49 51
50 } // namespace autofill 52 } // namespace autofill
OLDNEW
« no previous file with comments | « components/autofill/core/browser/field_candidates.h ('k') | components/mus/ws/platform_display_init_params.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698