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

Unified Diff: components/autofill/core/browser/personal_data_manager.cc

Issue 2398253003: Early exit from autofill profile de-duplication if <2 profiles. (Closed)
Patch Set: Created 4 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: components/autofill/core/browser/personal_data_manager.cc
diff --git a/components/autofill/core/browser/personal_data_manager.cc b/components/autofill/core/browser/personal_data_manager.cc
index ace4f444c181eee328349c6e30db36927665aa9e..7d188a742564db31fe4ca04a82884d5e7dd1103c 100644
--- a/components/autofill/core/browser/personal_data_manager.cc
+++ b/components/autofill/core/browser/personal_data_manager.cc
@@ -1650,7 +1650,13 @@ bool PersonalDataManager::ApplyDedupingRoutine() {
DCHECK(IsAutofillProfileCleanupEnabled());
is_autofill_profile_dedupe_pending_ = false;
- // Check if the deduping routine has already been run on this major version.
+ // No need to de-duplicate if there are less than two profiles.
+ if (web_profiles_.get().size() < 2) {
+ DVLOG(1) << "Autofill profile de-duplication not needed.";
+ return false;
+ }
+
+ // Check if de-duplication has already been performed this major version.
int current_major_version = atoi(version_info::GetVersionNumber().c_str());
if (pref_service_->GetInteger(prefs::kAutofillLastVersionDeduped) >=
current_major_version) {

Powered by Google App Engine
This is Rietveld 408576698