New issue
Advanced search Search tips

Issue 813565 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: May 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Bug



Sign in to add a comment

Background Fetch: Use downloadTotal property when provided by developer

Project Member Reported by na...@chromium.org, Feb 19 2018

Issue description

Use downloadTotal as described here (https://github.com/WICG/background-fetch#getting-an-instance-of-a-background-fetch). This can be used for instance in the logic that shows the progress bar for active downloads.

 

Comment 1 by peter@chromium.org, Feb 19 2018

Cc: -bever...@google.com peter@chromium.org
Components: Blink>BackgroundFetch

Comment 2 by na...@chromium.org, May 3 2018

Status: Started (was: Available)
Project Member

Comment 3 by bugdroid1@chromium.org, May 9 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/ff0c3108e5564a4ab74f2dd0e6e600bdd6c38480

commit ff0c3108e5564a4ab74f2dd0e6e600bdd6c38480
Author: Mugdha Lakhani <nator@chromium.org>
Date: Wed May 09 18:07:51 2018

[Background Fetch] Use downloadTotal in progress UI.

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}
[modify] https://crrev.com/ff0c3108e5564a4ab74f2dd0e6e600bdd6c38480/chrome/browser/background_fetch/background_fetch_browsertest.cc
[modify] https://crrev.com/ff0c3108e5564a4ab74f2dd0e6e600bdd6c38480/chrome/browser/background_fetch/background_fetch_delegate_impl.cc
[modify] https://crrev.com/ff0c3108e5564a4ab74f2dd0e6e600bdd6c38480/chrome/browser/background_fetch/background_fetch_delegate_impl.h
[modify] https://crrev.com/ff0c3108e5564a4ab74f2dd0e6e600bdd6c38480/chrome/test/data/background_fetch/background_fetch.js
[add] https://crrev.com/ff0c3108e5564a4ab74f2dd0e6e600bdd6c38480/chrome/test/data/background_fetch/types_of_cheese.txt
[modify] https://crrev.com/ff0c3108e5564a4ab74f2dd0e6e600bdd6c38480/content/browser/background_fetch/background_fetch_delegate_proxy.cc
[modify] https://crrev.com/ff0c3108e5564a4ab74f2dd0e6e600bdd6c38480/content/browser/background_fetch/background_fetch_delegate_proxy.h
[modify] https://crrev.com/ff0c3108e5564a4ab74f2dd0e6e600bdd6c38480/content/browser/background_fetch/background_fetch_delegate_proxy_unittest.cc
[modify] https://crrev.com/ff0c3108e5564a4ab74f2dd0e6e600bdd6c38480/content/browser/background_fetch/background_fetch_job_controller.cc
[modify] https://crrev.com/ff0c3108e5564a4ab74f2dd0e6e600bdd6c38480/content/browser/background_fetch/mock_background_fetch_delegate.cc
[modify] https://crrev.com/ff0c3108e5564a4ab74f2dd0e6e600bdd6c38480/content/browser/background_fetch/mock_background_fetch_delegate.h
[modify] https://crrev.com/ff0c3108e5564a4ab74f2dd0e6e600bdd6c38480/content/public/browser/BUILD.gn
[modify] https://crrev.com/ff0c3108e5564a4ab74f2dd0e6e600bdd6c38480/content/public/browser/background_fetch_delegate.h
[add] https://crrev.com/ff0c3108e5564a4ab74f2dd0e6e600bdd6c38480/content/public/browser/background_fetch_description.cc
[add] https://crrev.com/ff0c3108e5564a4ab74f2dd0e6e600bdd6c38480/content/public/browser/background_fetch_description.h

Comment 4 by na...@chromium.org, May 10 2018

Status: Fixed (was: Started)

Sign in to add a comment