• Toni Barzic's avatar
    Support delayed restore of persisted holding space items · 0083edd1
    Toni Barzic authored
    Moves responsibility for validating that holding space items restored
    from persistence delegate to file system delegate.
    The persistence delegate just de-serializes items from the persistent
    storage and adds them to the model as partially initialized items.
    
    File system delegate handles file path validity for non-finalized items,
    and removes items whose backing file path cannot be found from the
    model. This results in a simpler restoration flow where file validity
    checks can be unified.
    This CL updates the logic for file existence verification when items
    are restored from persistence to better items from mount points that
    are not immediately mounted very on startup (for example drive fs).
    
    The file system delegate will leave items whose file system URL cannot
    be resolved in partially initialized state until a mount point that
    parents the item is mounted.
    
    Note that the items will not remain in partially initialized state
    indefinitely - they will be cleaned up if the volume has not been
    mounted soon after startup.
    
    Renames ScopedTestDownloadsMountPoint into ScopedTestMountPoint and
    makes is a bit more customizable by tests - for example, enables tests
    to set up mount point state when the mount point is added to the
    external mount points.
    
    BUG=1140150
    
    Change-Id: I924b9b932039d1f1a1498dc3ce4b73ddeac0ddbb
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2490259Reviewed-by: default avatarJosh Nohle <nohle@chromium.org>
    Reviewed-by: default avatarDavid Black <dmblack@google.com>
    Commit-Queue: Toni Baržić <tbarzic@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#823849}
    0083edd1
nearby_notification_manager_unittest.cc 47.7 KB