Description[Background Fetch] Tidy up getting/activating pending requests
- Stop BackgroundFetchDataManager::CreateRegistration from invoking its
callback with an initial_requests vector that then has to be passed
around everywhere; instead have BackgroundFetchJobController directly
get the initial requests from BackgroundFetchDataManager using a
PopNextRequest method as it already does for subsequent requests.
- Rename BackgroundFetchDataManager::RegistrationData::GetPendingRequest
to PopNextPendingRequest since it also removes the request from the
pending queue.
- Split up the MarkRequestAsCompleteAndGetNextRequest method of
BackgroundFetchJobController so it re-uses PopNextRequest rather than
duplicating it.
- Remove BackgroundFetchJobController's brittle tracking of
pending_completed_file_acknowledgements_ since if/when multiple
requests are run in parallel, it would incorrectly report the job to
be complete as soon as the pending requests queue is exhausted, even
if other requests are still being downloaded. Instead just get an
accurate value for has_pending_or_active_requests from the
BackgroundFetchDataManager when marking requests complete.
BUG=none
Review-Url: https://codereview.chromium.org/2978603003
Cr-Commit-Position: refs/heads/master@{#485969}
Committed: https://chromium.googlesource.com/chromium/src/+/dd0e9b921a04328ae16ccba31883c655cfe42456
Patch Set 1 #
Total comments: 8
Patch Set 2 : Split up MarkRequestAsCompleteAndGetNextRequest and nuke pending_completed_file_acknowledgements_ #
Total comments: 8
Patch Set 3 : Address 2nd round review comments #Depends on Patchset: Messages
Total messages: 15 (7 generated)
|