Revert SyncDisableObserver to its pre-Unity version.
This CL reverts all code in the SyncDisableObserver to its state before http://crrev.com/c/1152744. It also disables all UKMBrowserTests for Unified Consent enabled feature as this not supported anymore. This is an attempt to verify whether http://crrev.com/c/1152744 is the culprit from the drop in UKM collected metrics seen in bug 891777. For reference - here is the diff of file sync_disable_observer.cc with the version before http://crrev.com/c/1152744: $ git diff 8f1b6d09 -- components/ukm/observers/sync_disable_observer.cc diff --git a/components/ukm/observers/sync_disable_observer.cc b/components/ukm/observers/sync_disable_observer.cc index f6d72866cfdd..beb5dac78eb5 100644 --- a/components/ukm/observers/sync_disable_observer.cc +++ b/components/ukm/observers/sync_disable_observer.cc @@ -68,7 +68,8 @@ SyncDisableObserver::SyncState SyncDisableObserver::GetSyncState( } void SyncDisableObserver::ObserveServiceForSyncDisables( - syncer::SyncService* sync_service) { + syncer::SyncService* sync_service, + PrefService* pref_service) { previous_states_[sync_service] = GetSyncState(sync_service); sync_observer_.Add(sync_service); UpdateAllProfileEnabled(false); $ git diff 8f1b6d09 -- components/ukm/observers/sync_disable_observer.h diff --git a/components/ukm/observers/sync_disable_observer.h b/components/ukm/observers/sync_disable_observer.h index 2de46181f0f5..2b89842addcb 100644 --- a/components/ukm/observers/sync_disable_observer.h +++ b/components/ukm/observers/sync_disable_observer.h @@ -11,6 +11,8 @@ #include "components/sync/driver/sync_service.h" #include "components/sync/driver/sync_service_observer.h" +class PrefService; + namespace ukm { // Observes the state of a set of SyncServices for changes to history sync @@ -23,7 +25,8 @@ class SyncDisableObserver : public syncer::SyncServiceObserver { ~SyncDisableObserver() override; // Starts observing a service for sync disables. - void ObserveServiceForSyncDisables(syncer::SyncService* sync_service); + void ObserveServiceForSyncDisables(syncer::SyncService* sync_service, + PrefService* pref_service); // Returns true iff sync is in a state that allows UKM to be enabled. // This means that for all profiles, sync is initialized, connected, has the Bug: 891777 Change-Id: Ie55d4df1a66454918fa4931b3cc5000dade1d3e9 Reviewed-on: https://chromium-review.googlesource.com/c/1264781Reviewed-by:Robert Kaplow (sloooow) <rkaplow@chromium.org> Reviewed-by:
Alexei Svitkine <asvitkine@chromium.org> Reviewed-by:
Brian White <bcwhite@chromium.org> Commit-Queue: Mihai Sardarescu <msarda@chromium.org> Cr-Commit-Position: refs/heads/master@{#597298}
Showing
This diff is collapsed.
Please register or sign in to comment