Add DownloadService startup recovery

Desktop / Chromium - David Trainor [chromium.org] - 16 June 2017 20:01 EDT

Add logic to handle state machine corruption resolution on startup. This patch does the following:

- Adds logic to resolve the two state machines (DownloadService and DownloadManager).- Iterates over all downloads in the Model at startup and figures out the correct state.- Once the correct state has been identified, takes the appropriate action on the download entries.

Bug: Change-Id: I3fd668934ac6bfab94fc1665c3ade73de4871067 Reviewed-on: https://chromium-review.googlesource.com/538079 Commit-Queue: David Trainor

2f05920 Add DownloadService startup recovery
components/download/internal/controller_impl.cc | 168 +++++++++++++++++---
components/download/internal/controller_impl.h | 19 ++-
.../download/internal/controller_impl_unittest.cc | 171 ++++++++++++++++++++-
.../internal/proto_conversions_unittest.cc | 7 +-
components/download/internal/stats.cc | 4 +
components/download/internal/stats.h | 5 +
components/download/internal/test/test_store.cc | 16 +-
components/download/internal/test/test_store.h | 3 +
8 files changed, 363 insertions(+), 30 deletions(-)

Upstream: git.chromium.org


  • Share