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/personal_data_manager.h" | 5 #include "components/autofill/core/browser/personal_data_manager.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <functional> | 8 #include <functional> |
9 #include <iterator> | 9 #include <iterator> |
10 | 10 |
11 #include "base/i18n/timezone.h" | 11 #include "base/i18n/timezone.h" |
12 #include "base/logging.h" | 12 #include "base/logging.h" |
13 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
14 #include "base/prefs/pref_service.h" | 14 #include "base/prefs/pref_service.h" |
| 15 #include "base/profiler/scoped_profile.h" |
15 #include "base/strings/string_number_conversions.h" | 16 #include "base/strings/string_number_conversions.h" |
16 #include "base/strings/string_util.h" | 17 #include "base/strings/string_util.h" |
17 #include "base/strings/utf_string_conversions.h" | 18 #include "base/strings/utf_string_conversions.h" |
18 #include "components/autofill/core/browser/address_i18n.h" | 19 #include "components/autofill/core/browser/address_i18n.h" |
19 #include "components/autofill/core/browser/autofill-inl.h" | 20 #include "components/autofill/core/browser/autofill-inl.h" |
20 #include "components/autofill/core/browser/autofill_country.h" | 21 #include "components/autofill/core/browser/autofill_country.h" |
21 #include "components/autofill/core/browser/autofill_field.h" | 22 #include "components/autofill/core/browser/autofill_field.h" |
22 #include "components/autofill/core/browser/form_structure.h" | 23 #include "components/autofill/core/browser/form_structure.h" |
23 #include "components/autofill/core/browser/personal_data_manager_observer.h" | 24 #include "components/autofill/core/browser/personal_data_manager_observer.h" |
24 #include "components/autofill/core/browser/phone_number.h" | 25 #include "components/autofill/core/browser/phone_number.h" |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
181 CancelPendingQuery(&pending_profiles_query_); | 182 CancelPendingQuery(&pending_profiles_query_); |
182 CancelPendingQuery(&pending_creditcards_query_); | 183 CancelPendingQuery(&pending_creditcards_query_); |
183 | 184 |
184 if (database_.get()) | 185 if (database_.get()) |
185 database_->RemoveObserver(this); | 186 database_->RemoveObserver(this); |
186 } | 187 } |
187 | 188 |
188 void PersonalDataManager::OnWebDataServiceRequestDone( | 189 void PersonalDataManager::OnWebDataServiceRequestDone( |
189 WebDataServiceBase::Handle h, | 190 WebDataServiceBase::Handle h, |
190 const WDTypedResult* result) { | 191 const WDTypedResult* result) { |
| 192 // TODO(vadimt): Remove ScopedProfile below once crbug.com/422460 is fixed. |
| 193 tracked_objects::ScopedProfile tracking_profile( |
| 194 FROM_HERE_WITH_EXPLICIT_FUNCTION( |
| 195 "422460 PersonalDataManager::OnWebDataServiceRequestDone")); |
| 196 |
191 DCHECK(pending_profiles_query_ || pending_creditcards_query_); | 197 DCHECK(pending_profiles_query_ || pending_creditcards_query_); |
192 | 198 |
193 if (!result) { | 199 if (!result) { |
194 // Error from the web database. | 200 // Error from the web database. |
195 if (h == pending_creditcards_query_) | 201 if (h == pending_creditcards_query_) |
196 pending_creditcards_query_ = 0; | 202 pending_creditcards_query_ = 0; |
197 else if (h == pending_profiles_query_) | 203 else if (h == pending_profiles_query_) |
198 pending_profiles_query_ = 0; | 204 pending_profiles_query_ = 0; |
199 return; | 205 return; |
200 } | 206 } |
(...skipping 909 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1110 // Populates |auxiliary_profiles_|. | 1116 // Populates |auxiliary_profiles_|. |
1111 LoadAuxiliaryProfiles(record_metrics); | 1117 LoadAuxiliaryProfiles(record_metrics); |
1112 | 1118 |
1113 profiles_.insert(profiles_.end(), web_profiles_.begin(), web_profiles_.end()); | 1119 profiles_.insert(profiles_.end(), web_profiles_.begin(), web_profiles_.end()); |
1114 profiles_.insert( | 1120 profiles_.insert( |
1115 profiles_.end(), auxiliary_profiles_.begin(), auxiliary_profiles_.end()); | 1121 profiles_.end(), auxiliary_profiles_.begin(), auxiliary_profiles_.end()); |
1116 return profiles_; | 1122 return profiles_; |
1117 } | 1123 } |
1118 | 1124 |
1119 } // namespace autofill | 1125 } // namespace autofill |
OLD | NEW |