-
Mugdha Lakhani authored
downloadTotal is a field that can be set by the developer from the fetch() API, through BackgroundFetchOptions (https://wicg.github.io/background-fetch/#dictdef-backgroundfetchoptions). Before this change, the progress bar in the UI showed a percentage based on number of files downloaded. After this change, the progress bar will use bytes downloaded out of total bytes to be downloaded to calculate this percentage. If downloadTotal is set incorrectly (larger than total size of downloads), or not set at all, we fall back to previous behavior. Additionally, we update the progress bar more often with this change -- whenever DownloadManager notifies us of more bytes downloaded (~500 ms) instead of only updating when a download is completed or aborted. Bug: 813565 Change-Id: Ia704ea99b9ee3966aabb3f64a4ccd2112e36ab80 Reviewed-on: https://chromium-review.googlesource.com/998105 Commit-Queue: Mugdha Lakhani <nator@chromium.org> Reviewed-by:
Peter Beverloo <peter@chromium.org> Reviewed-by:
Kinuko Yasuda <kinuko@chromium.org> Cr-Commit-Position: refs/heads/master@{#557243}
ff0c3108