Add a recovery method to FileMonitor

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

Add a method that resets FileMonitor in a hard recovery attempt. This CL will, with subsequent CLs that add similar recovery methods to other components, allow recovering (or at least cleaning up) a failed DownloadService Controller.

The cleanup steps are: 1. Try to erase all files in the directory. 2. Attempt to re-initialize the component (make sure the directory is created and accessed). 3. Return the result of the re-initialization to the caller.

BUG=736222

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

c6358cc Add a recovery method to FileMonitor
components/download/internal/controller_impl.cc | 4 +-
.../download/internal/controller_impl_unittest.cc | 4 +-
components/download/internal/file_monitor.h | 7 +-
components/download/internal/file_monitor_impl.cc | 120 ++++++++++++---------
components/download/internal/file_monitor_impl.h | 8 +-
.../download/internal/file_monitor_unittest.cc | 28 +++++
components/download/internal/stats.h | 2 +
7 files changed, 112 insertions(+), 61 deletions(-)

Upstream: git.chromium.org


  • Share