https://chromium-review.googlesource.com/c/597407 introduced a IsShuttingDown() method to ApplicationContext to allow deciding whether the snapshot have to be destroyed when a Tab is closed.
This was introduced to fix a regression but the API feels wrong (non-local). A better API needs to be designed.
Possible options:
1. introduce an additional API to inform that a Tab is closed to an user action (like TabStripModel::CloseWebContents does)
2. only cleanup snapshots on startup
Currently, I would say that option 1. is probably the better alternative but will require some refactoring of TabModel and Tab.
Comment 1 by sdefresne@chromium.org
, Aug 8 2017Components: UI>Browser>Sessions UI>Browser>Mobile>TabSwitcher