• Rushan Suleymanov's avatar
    Revert "Unify clearing of sync prefs" · 232ad148
    Rushan Suleymanov authored
    This reverts commit 44d3aa82.
    
    Reason for revert: suspect of running into sync protocol violations and the corresponding DCHECK failures.
    
    Original change's description:
    > Unify clearing of sync prefs
    > 
    > SyncPrefs is a thin layer on top of preferences and hosts two groups
    > of preferences:
    > 1) Actual user-facing settings, such as type-selection, exposed via
    >    SyncUserSettings.
    > 2) Local "bookkeeping" sync metadata, such the last synced time or the
    >    client ID (cache GUID).
    > 
    > In addition, there are two cases that fall somewhere in the middle,
    > whose behavior is changed in this patch:
    > a) FirstSetupComplete: which roughly represents the user having
    >    consented to sync-the-feature (as opposed to transport-only upon
    >    sign-in without explicit user consent).
    > b) The encryption-bootstrap-token: which represent an explicit
    >    passphrase (usually custom passphrase) entered by the user, that
    >    allows decrypting the incoming sync changes and encrypt outgoing
    >    ones.
    > 
    > The last two preferences above fit group 1 better, so this patch stops
    > clearing them in SyncPrefs::ClearPreferences(), now renamed to
    > SyncPrefs::ClearLocalSyncTransportData().
    > 
    > With such cleanup, what used to be
    > ClearDirectoryConsistencyPreferences() is now merged into a single
    > clearing function, ClearLocalSyncTransportData(), and all calling sites
    > are unified by directly clearing prefs in ShutdownImpl(DISABLE_SYNC), as
    > opposed to individual calling sites.
    > 
    > This introduces -arguably desirable- behavioral changes because
    > codepaths like RESET_LOCAL_SYNC_DATA or STOP_SYNC_FOR_DISABLED_ACCOUNT
    > now actually clear all local metadata, which most notably includes
    > keystore keys.
    > 
    > Change-Id: I2c42f98c4e068c7e340580d0b78a5cd5b5c46171
    > Bug: 1046237
    > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2023649
    > Commit-Queue: Mikel Astiz <mastiz@chromium.org>
    > Reviewed-by: Marc Treib <treib@chromium.org>
    > Cr-Commit-Position: refs/heads/master@{#735841}
    
    TBR=treib@chromium.org,mastiz@chromium.org
    
    # Not skipping CQ checks because original CL landed > 1 day ago.
    
    Bug: 1046237, 1048771
    Change-Id: I4ce9e941f12aa58b7b6b286e990e74a1e01dad69
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2043451
    Commit-Queue: Rushan Suleymanov <rushans@google.com>
    Reviewed-by: default avatarMikel Astiz <mastiz@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#739374}
    232ad148
profile_sync_service.cc 78.8 KB