Allow clients to optionally extend the window by saying that they still have a download job active. This could look like the following Client API: bool CanServiceRemoveDownloadedFile(const std::string& guid);
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/b567f21841281780406a1658bfe097981b81104b commit b567f21841281780406a1658bfe097981b81104b Author: Shakti Sahu <shaktisahu@chromium.org> Date: Thu Aug 24 16:22:33 2017 Download Service : Extend file deletion window. Added ability for clients to extend the file deletion window. A client method CanServiceRemoveDownloadedFile() would be called before removing the file. If client says no, we would extend the file lifetime by another |file_keep_alive_time| unless the file has gotten too many lifetimes which is tracked by another config |max_file_keep_alive_time(default=7 days)|, in which case we would forcefully delete the file regardless of the client's wish. A field |keep_alive_until| was added to the Entry DB to keep this value. Bug: 745842 Change-Id: Ia208dd5dcb285fafc05d6beae5b3ae1fa5f5890e Reviewed-on: https://chromium-review.googlesource.com/612741 Reviewed-by: Ilya Sherman <isherman@chromium.org> Reviewed-by: Jian Li <jianli@chromium.org> Reviewed-by: David Trainor <dtrainor@chromium.org> Reviewed-by: Xing Liu <xingliu@chromium.org> Commit-Queue: Shakti Sahu <shaktisahu@chromium.org> Cr-Commit-Position: refs/heads/master@{#497076} [modify] https://crrev.com/b567f21841281780406a1658bfe097981b81104b/chrome/browser/offline_pages/prefetch/offline_prefetch_download_client.cc [modify] https://crrev.com/b567f21841281780406a1658bfe097981b81104b/chrome/browser/offline_pages/prefetch/offline_prefetch_download_client.h [modify] https://crrev.com/b567f21841281780406a1658bfe097981b81104b/components/download/internal/config.cc [modify] https://crrev.com/b567f21841281780406a1658bfe097981b81104b/components/download/internal/config.h [modify] https://crrev.com/b567f21841281780406a1658bfe097981b81104b/components/download/internal/controller_impl.cc [modify] https://crrev.com/b567f21841281780406a1658bfe097981b81104b/components/download/internal/controller_impl_unittest.cc [modify] https://crrev.com/b567f21841281780406a1658bfe097981b81104b/components/download/internal/entry.cc [modify] https://crrev.com/b567f21841281780406a1658bfe097981b81104b/components/download/internal/entry.h [modify] https://crrev.com/b567f21841281780406a1658bfe097981b81104b/components/download/internal/file_monitor.h [modify] https://crrev.com/b567f21841281780406a1658bfe097981b81104b/components/download/internal/file_monitor_impl.cc [modify] https://crrev.com/b567f21841281780406a1658bfe097981b81104b/components/download/internal/file_monitor_impl.h [modify] https://crrev.com/b567f21841281780406a1658bfe097981b81104b/components/download/internal/file_monitor_unittest.cc [modify] https://crrev.com/b567f21841281780406a1658bfe097981b81104b/components/download/internal/proto/entry.proto [modify] https://crrev.com/b567f21841281780406a1658bfe097981b81104b/components/download/internal/proto_conversions.cc [modify] https://crrev.com/b567f21841281780406a1658bfe097981b81104b/components/download/internal/proto_conversions_unittest.cc [modify] https://crrev.com/b567f21841281780406a1658bfe097981b81104b/components/download/internal/stats.cc [modify] https://crrev.com/b567f21841281780406a1658bfe097981b81104b/components/download/internal/stats.h [modify] https://crrev.com/b567f21841281780406a1658bfe097981b81104b/components/download/internal/test/empty_client.cc [modify] https://crrev.com/b567f21841281780406a1658bfe097981b81104b/components/download/internal/test/empty_client.h [modify] https://crrev.com/b567f21841281780406a1658bfe097981b81104b/components/download/internal/test/entry_utils.cc [modify] https://crrev.com/b567f21841281780406a1658bfe097981b81104b/components/download/internal/test/entry_utils.h [modify] https://crrev.com/b567f21841281780406a1658bfe097981b81104b/components/download/internal/test/mock_client.h [modify] https://crrev.com/b567f21841281780406a1658bfe097981b81104b/components/download/public/client.h [modify] https://crrev.com/b567f21841281780406a1658bfe097981b81104b/tools/metrics/histograms/histograms.xml
Comment 1 by dtrainor@chromium.org
, Jul 20 2017Status: Assigned (was: Available)