• Mikel Astiz's avatar
    Defer initial_sync_done for commit-only types · a1022547
    Mikel Astiz authored
    Instead of assuming IsTrackingMetadata() as soon as the model is ready
    to sync, we now do it when:
    a) The model is ready to sync.
    b) Sync is known to be enabled (either because it just got enabled, or
       because we know from persisted data that is was previously enabled).
    
    This makes commit-only types more similar to regular types, and allows
    bridges to leverage the state. For example, while sync is enabled (i.e.
    IsTrackingMetadata()), there should always be means to know which
    account ID is syncing, which is now exposed in ModelTypeChangeProcessor.
    
    From the bridge's perspective, the only transition from not tracking
    metadata, and metadata being tracked (sync enabled), is MergeSyncData().
    
    ModelReadyToSync() now presents the transition from unknown (i.e. unsure
    whether sync is enabled or not until sync metadata is read from disk)
    to true/false depending on the persisted value (true if sync was running
    for the datatype in previous executions of the browser). Just like for
    regular (non-commit-only) datatypes.
    
    Bug: 830535
    Change-Id: I573e27c2dcde1bd5835c30319065c178eb7b4679
    Reviewed-on: https://chromium-review.googlesource.com/c/1136307Reviewed-by: default avatarOlivier Robin <olivierrobin@chromium.org>
    Reviewed-by: default avatarMarkus Heintz <markusheintz@chromium.org>
    Reviewed-by: default avatarvitaliii <vitaliii@chromium.org>
    Commit-Queue: Mikel Astiz <mastiz@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#607207}
    a1022547
consent_sync_bridge_impl.cc 11 KB