[AF] Debug logs in wallet_metadata sync for flaky integration test

To be reverted as soon as the issue is found.

Bug: 915229
Change-Id: I81e9d1f7fa23eee957df8256fa858e210af620c8
Reviewed-on: https://chromium-review.googlesource.com/c/1377438
Commit-Queue: Jan Krcal <jkrcal@chromium.org>
Reviewed-by: Sebastien Seguin-Gagnon <sebsg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#616798}
diff --git a/components/autofill/core/browser/personal_data_manager.cc b/components/autofill/core/browser/personal_data_manager.cc
index a137f19..f5c2371 100644
--- a/components/autofill/core/browser/personal_data_manager.cc
+++ b/components/autofill/core/browser/personal_data_manager.cc
@@ -621,12 +621,16 @@
     }
 
     is_data_loaded_ = true;
+    // TODO(crbug.com/915229): Remove once the investigation is over.
+    DLOG(WARNING) << this << " refresh is done, notifying PersonalDataChanged";
     NotifyPersonalDataChanged();
   }
 }
 
 void PersonalDataManager::AutofillMultipleChanged() {
   has_synced_new_data_ = true;
+  // TODO(crbug.com/915229): Remove once the investigation is over.
+  DLOG(WARNING) << this << " has synced new data, refreshing";
   Refresh();
 }
 
@@ -2453,6 +2457,9 @@
     UpdateCardsBillingAddressReference(guids_merge_map);
 
     // Force a reload of the profiles and cards.
+    // TODO(crbug.com/915229): Remove once the investigation is over.
+    if (has_converted_addresses)
+      DLOG(WARNING) << this << " conversion of addresses done";
     Refresh();
   }
 }
@@ -2490,6 +2497,8 @@
 
       // Update the wallet addresses metadata to record the conversion.
       wallet_address->set_has_converted(true);
+      // TODO(crbug.com/915229): Remove once the investigation is over.
+      DLOG(WARNING) << this << " converting address " << *wallet_address;
       database_helper_->GetServerDatabase()->UpdateServerAddressMetadata(
           *wallet_address);
 
diff --git a/components/autofill/core/browser/webdata/autofill_wallet_metadata_syncable_service.cc b/components/autofill/core/browser/webdata/autofill_wallet_metadata_syncable_service.cc
index 40ef9b4..48911cd 100644
--- a/components/autofill/core/browser/webdata/autofill_wallet_metadata_syncable_service.cc
+++ b/components/autofill/core/browser/webdata/autofill_wallet_metadata_syncable_service.cc
@@ -511,6 +511,8 @@
     // get rid of this hack.
     DCHECK(!ignore_multiple_changed_notification_);
     ignore_multiple_changed_notification_ = true;
+    // TODO(crbug.com/915229): Remove once the investigation is over.
+    DLOG(WARNING) << this << " ProcessSyncChanges notify the PDM";
     web_data_backend_->NotifyOfMultipleAutofillChanges();
     ignore_multiple_changed_notification_ = false;
   }
@@ -539,8 +541,13 @@
         it->GetSpecifics().wallet_metadata();
     const AutofillProfile& local = *change.data_model();
 
+    // TODO(crbug.com/915229): Remove once the investigation is over.
+    DLOG(WARNING) << this << " AutofillProfileChanged " << local;
+
     if (!AreLocalUseStatsUpdated(remote, local) &&
         !IsLocalHasConvertedStatusUpdated(remote, local)) {
+      // TODO(crbug.com/915229): Remove once the investigation is over.
+      DLOG(WARNING) << this << " Nothing has changed, not syncing up.";
       return;
     }
 
@@ -655,6 +662,8 @@
 
 bool AutofillWalletMetadataSyncableService::UpdateAddressStats(
     const AutofillProfile& profile) {
+  // TODO(crbug.com/915229): Remove once the investigation is over.
+  DLOG(WARNING) << this << " Applying change from sync " << profile;
   return AutofillTable::FromWebDatabase(web_data_backend_->GetDatabase())
       ->UpdateServerAddressMetadata(profile);
 }
@@ -754,6 +763,8 @@
     // get rid of this hack.
     DCHECK(!ignore_multiple_changed_notification_);
     ignore_multiple_changed_notification_ = true;
+    // TODO(crbug.com/915229): Remove once the investigation is over.
+    DLOG(WARNING) << this << " MergeData notify the PDM";
     web_data_backend_->NotifyOfMultipleAutofillChanges();
     ignore_multiple_changed_notification_ = false;
   }