Invalidations are push messages from the Sync server saying that new data is available for some data types, so the client can run GetUpdates right away instead of waiting for the next poll (step 1 of the remote change workflow in the architecture overview). Polling continues regardless, so invalidations reduce latency rather than being the only trigger for a sync cycle. This directory implements the client side of that channel on top of FCM (Firebase Cloud Messaging) via components/gcm_driver/: it registers the profile with FCM, hands incoming messages to listeners and tracks which data types the device wants invalidations for.
Everything here runs on the UI thread, the sequence that owns the profile's KeyedServices.
SyncInvalidationsService is the public interface, a per-profile KeyedService (implemented by SyncInvalidationsServiceImpl and created by SyncInvalidationsServiceFactory, see chrome/browser/sync/sync_invalidations_service_factory.h). SyncServiceImpl drives its lifecycle through StartListening(), SetInterestedDataTypes(), StopListening() and StopListeningPermanently().InvalidationsListener: implement it and call AddListener() to receive incoming invalidation payloads. A listener added late gets the most recently buffered messages replayed, so invalidations that arrive while the engine is still starting are not lost. Current listeners include SyncEngineImpl, which hands the payload to the engine on the sync sequence, and SyncInternalsMessageHandler for chrome://sync-internals.FCMRegistrationTokenObserver: implement it and call AddTokenObserver() to learn when the token returned by GetFCMRegistrationToken() is obtained, changes or is cleared.InterestedDataTypesHandler: the single handler, set with SetInterestedDataTypesHandler(), is told whenever the set of interested data types changes.DeviceInfo entity (InvalidationSpecificFields). DeviceInfoSyncServiceImpl implements both InterestedDataTypesHandler and FCMRegistrationTokenObserver for that purpose and commits a refreshed DeviceInfo whenever either changes.No public design doc covers this directory specifically. Related public pages:
chrome://sync-internals, where received invalidations can be inspected.