• edchin's avatar
    [ios] Restore snapshot for undo close all tabs · 45ab3fe6
    edchin authored
    When closing tabs, an observer immediately deletes snapshots from the
    snapshot cache. This prevents snapshots from reappearing in an undo
    close all tabs operation.
    
    This CL enables snapshot restoration on undo close all tabs by extending
    the life of a snapshot when closed with a "close all" operation. Note
    this is only extended for regular tabs, not incognito tabs.
    
    The extended life is accomplished by marking tabs for deletion during
    a close all operation, rather than immediately deleting the image
    from the cache. Later, the marked images are either purged from the
    cache, or the marked list is cleared (therefore leaving the images in
    the cache).
    
    Bug: 804567
    Cq-Include-Trybots: master.tryserver.chromium.mac:ios-simulator-cronet;master.tryserver.chromium.mac:ios-simulator-full-configs
    Change-Id: I4710bf46d3ebd4ad347563e5f6a6208a68a58209
    Reviewed-on: https://chromium-review.googlesource.com/1041545
    Commit-Queue: edchin <edchin@chromium.org>
    Reviewed-by: default avatarEugene But <eugenebut@chromium.org>
    Reviewed-by: default avataredchin <edchin@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#556162}
    45ab3fe6
snapshot_cache.mm 23.2 KB