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

Side by Side Diff: third_party/libaddressinput/chromium/chrome_address_validator.cc

Issue 1911823002: Convert //third_party from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update crashpad's README.chromium Created 4 years, 8 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "third_party/libaddressinput/chromium/chrome_address_validator.h" 5 #include "third_party/libaddressinput/chromium/chrome_address_validator.h"
6 6
7 #include <cmath> 7 #include <cmath>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/location.h" 10 #include "base/location.h"
(...skipping 20 matching lines...) Expand all
31 31
32 using ::i18n::addressinput::ADMIN_AREA; 32 using ::i18n::addressinput::ADMIN_AREA;
33 using ::i18n::addressinput::DEPENDENT_LOCALITY; 33 using ::i18n::addressinput::DEPENDENT_LOCALITY;
34 using ::i18n::addressinput::POSTAL_CODE; 34 using ::i18n::addressinput::POSTAL_CODE;
35 35
36 // The maximum number attempts to load rules. 36 // The maximum number attempts to load rules.
37 static const int kMaxAttemptsNumber = 8; 37 static const int kMaxAttemptsNumber = 8;
38 38
39 } // namespace 39 } // namespace
40 40
41 AddressValidator::AddressValidator(scoped_ptr<Source> source, 41 AddressValidator::AddressValidator(std::unique_ptr<Source> source,
42 scoped_ptr<Storage> storage, 42 std::unique_ptr<Storage> storage,
43 LoadRulesListener* load_rules_listener) 43 LoadRulesListener* load_rules_listener)
44 : supplier_(new PreloadSupplier(source.release(), 44 : supplier_(new PreloadSupplier(source.release(), storage.release())),
45 storage.release())),
46 input_suggester_(new InputSuggester(supplier_.get())), 45 input_suggester_(new InputSuggester(supplier_.get())),
47 normalizer_(new AddressNormalizer(supplier_.get())), 46 normalizer_(new AddressNormalizer(supplier_.get())),
48 validator_(new ::i18n::addressinput::AddressValidator(supplier_.get())), 47 validator_(new ::i18n::addressinput::AddressValidator(supplier_.get())),
49 validated_(BuildCallback(this, &AddressValidator::Validated)), 48 validated_(BuildCallback(this, &AddressValidator::Validated)),
50 rules_loaded_(BuildCallback(this, &AddressValidator::RulesLoaded)), 49 rules_loaded_(BuildCallback(this, &AddressValidator::RulesLoaded)),
51 load_rules_listener_(load_rules_listener), 50 load_rules_listener_(load_rules_listener),
52 weak_factory_(this) {} 51 weak_factory_(this) {}
53 52
54 AddressValidator::~AddressValidator() {} 53 AddressValidator::~AddressValidator() {}
55 54
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 region_code), 154 region_code),
156 GetBaseRetryPeriod() * pow(2, attempts_number_[region_code]++)); 155 GetBaseRetryPeriod() * pow(2, attempts_number_[region_code]++));
157 } 156 }
158 157
159 void AddressValidator::RetryLoadRules(const std::string& region_code) { 158 void AddressValidator::RetryLoadRules(const std::string& region_code) {
160 // Do not reset retry count. 159 // Do not reset retry count.
161 supplier_->LoadRules(region_code, *rules_loaded_); 160 supplier_->LoadRules(region_code, *rules_loaded_);
162 } 161 }
163 162
164 } // namespace autofill 163 } // namespace autofill
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698