Add recovery method to the Model

Desktop / Chromium - David Trainor [chromium.org] - 17 July 2017 14:14 EDT

Add the way for the DownloadService Model to attempt a hard recovery. This will be used along with other component CLs to allow the DownloadService to attempt to reset itself.

The recovery method for the Model happens via the following steps: 1. Clears the Model of all Entries. 2. Has the Store destroy itself. 3. The Store attempts to re-initialize. 4. Return the result back to the Model::Client.

BUG=736222

Change-Id: I4e0a256d0b241ef627d457d9c2276691d61da8ce Reviewed-on: https://chromium-review.googlesource.com/568712 Commit-Queue: David Trainor

bcf45bc Add recovery method to the Model
components/download/internal/controller_impl.cc | 4 ++
components/download/internal/controller_impl.h | 1 +
components/download/internal/download_store.cc | 24 +++++++
components/download/internal/download_store.h | 3 +
.../download/internal/download_store_unittest.cc | 84 ++++++++++++++++++++++
components/download/internal/model.h | 9 +++
components/download/internal/model_impl.cc | 11 +++
components/download/internal/model_impl.h | 2 +
.../download/internal/model_impl_unittest.cc | 64 +++++++++++++++++
components/download/internal/store.h | 3 +
.../download/internal/test/mock_model_client.h | 1 +
components/download/internal/test/noop_store.cc | 6 ++
components/download/internal/test/noop_store.h | 1 +
components/download/internal/test/test_store.cc | 12 ++++
components/download/internal/test/test_store.h | 3 +
components/leveldb_proto/testing/fake_db.h | 13 +++-
16 files changed, 240 insertions(+), 1 deletion(-)

Upstream: git.chromium.org


  • Share