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

Unified Diff: components/sync/device_info/device_info_service.cc

Issue 2451793003: [Sync] Avoid sending the processor metadata again on re-enabling sync. (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/sync/device_info/device_info_service.cc
diff --git a/components/sync/device_info/device_info_service.cc b/components/sync/device_info/device_info_service.cc
index b13f1d4e5d4db5d372cac9ead0d2e6eff0882c77..f00c6c8ea4114464ca896f7c6488b179e61989b7 100644
--- a/components/sync/device_info/device_info_service.cc
+++ b/components/sync/device_info/device_info_service.cc
@@ -277,6 +277,12 @@ bool DeviceInfoService::DeleteSpecifics(const std::string& guid,
}
void DeviceInfoService::OnProviderInitialized() {
+ // Now that the provider has initialized, remove the subscription. The service
+ // should only need to give the processor metadata upon initialization. If
+ // sync is disabled and enabled, our provider will try to retrigger this
+ // event, but we do not want to send any more metadata to the processor.
+ subscription_.reset();
+
has_provider_initialized_ = true;
LoadMetadataIfReady();
}

Powered by Google App Engine
This is Rietveld 408576698