New issue
Advanced search Search tips

Issue 834011 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: May 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Android
Pri: 1
Type: Bug



Sign in to add a comment

[Background download] Support background fetch's download quota

Project Member Reported by xingliu@chromium.org, Apr 17 2018

Issue description

Since background fetch team would like to implement a bytes quota on a group of download requests, background download service API can be tweaked for this demand.

Background fetch can implement the quota with following existing API.

1. Client::OnServiceInitialized where it exposes the guid of download in DownloadMetadata. 

2. Client::OnDownloadUpdated exposes the guid and bytes downloaded.

3. DownloadService::CancelDownload can be used to stop any download request if the it exceeds the quota.

======================================================================

TODOs:

1. Client::OnServiceInitialized can expose the bytes_downloaded, so it will be easier to get an initial states of all download requests.

 

Comment 1 Deleted

Project Member

Comment 2 by bugdroid1@chromium.org, May 1 2018

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

commit 41ce5a7add26e747b75529125172e6a9b36e2b02
Author: Xing Liu <xingliu@chromium.org>
Date: Tue May 01 01:07:44 2018

Background download: Move bytes_downloaded to DownloadMetadata.

This CL adds bytes_downloaded in DownloadMetadata, so background fetch
can get the current size in download::Client::OnServiceInitialized call.

Change-Id: I283a8a89e4adac038e91b49b4598db5a9b023839
Bug:  834011 
Reviewed-on: https://chromium-review.googlesource.com/1014269
Commit-Queue: Xing Liu <xingliu@chromium.org>
Reviewed-by: David Trainor <dtrainor@chromium.org>
Cr-Commit-Position: refs/heads/master@{#554951}
[modify] https://crrev.com/41ce5a7add26e747b75529125172e6a9b36e2b02/components/download/internal/background_service/controller_impl.cc
[modify] https://crrev.com/41ce5a7add26e747b75529125172e6a9b36e2b02/components/download/internal/background_service/controller_impl_unittest.cc
[modify] https://crrev.com/41ce5a7add26e747b75529125172e6a9b36e2b02/components/download/internal/background_service/entry_utils.cc
[modify] https://crrev.com/41ce5a7add26e747b75529125172e6a9b36e2b02/components/download/internal/background_service/entry_utils.h
[modify] https://crrev.com/41ce5a7add26e747b75529125172e6a9b36e2b02/components/download/internal/background_service/entry_utils_unittest.cc
[modify] https://crrev.com/41ce5a7add26e747b75529125172e6a9b36e2b02/components/download/public/background_service/download_metadata.cc
[modify] https://crrev.com/41ce5a7add26e747b75529125172e6a9b36e2b02/components/download/public/background_service/download_metadata.h

Status: Fixed (was: Started)

Sign in to add a comment