
Remove the check of whether all the WebState's data file are present when loading the metadata for a session. This performed poorly for users with thousands of tabs, and is not enough to ensure that the data could be loaded (e.g. loading can fail even if the file exists if the data is corrupt, or it could be removed by the time the code tries to load it). Change the prototype of WebStateStorageLoader to propagate failing to load the WebStateStorage (by returning std::nullopt) and create a default storage from the metadata if possible. This ensure that the tab will at least navigate to the last visible URL even if the navigation history was lost. This should improve the startup time by removing disk access from the hot path and should reduce the risk of losing tabs because it will only happen if the metadata themselves are invalid, not if a few tabs data has disappeared. Bug: none Change-Id: I3c088368039472209be9eb75c28b49c0dc9d34bb Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6377364 Reviewed-by: Justin Cohen <justincohen@chromium.org> Commit-Queue: Sylvain Defresne <sdefresne@chromium.org> Auto-Submit: Sylvain Defresne <sdefresne@chromium.org> Cr-Commit-Position: refs/heads/main@{#1435626}
Tools used during the build or running tests or sometimes just things that people have found useful while working on Chromium.