Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(339)

Issue 2978603003: [Background Fetch] Tidy up getting/activating pending requests (Closed)

Created:
3 years, 5 months ago by johnme
Modified:
3 years, 5 months ago
CC:
chromium-reviews, Peter Beverloo, jam, johnme+watch_chromium.org, darin-cc_chromium.org, awdf+watch_chromium.org
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

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 #

Messages

Total messages: 15 (7 generated)
johnme
3 years, 5 months ago (2017-07-11 15:59:13 UTC) #2
Peter Beverloo
Nice clean-up! Thanks https://codereview.chromium.org/2978603003/diff/1/content/browser/background_fetch/background_fetch_data_manager.h File content/browser/background_fetch/background_fetch_data_manager.h (right): https://codereview.chromium.org/2978603003/diff/1/content/browser/background_fetch/background_fetch_data_manager.h#newcode63 content/browser/background_fetch/background_fetch_data_manager.h:63: NextRequestCallback callback); I'm not a fan ...
3 years, 5 months ago (2017-07-11 16:10:55 UTC) #3
johnme
Addressed review comments (and expanded CL description accordingly) - thanks! https://codereview.chromium.org/2978603003/diff/1/content/browser/background_fetch/background_fetch_data_manager.h File content/browser/background_fetch/background_fetch_data_manager.h (right): https://codereview.chromium.org/2978603003/diff/1/content/browser/background_fetch/background_fetch_data_manager.h#newcode63 ...
3 years, 5 months ago (2017-07-12 13:13:10 UTC) #5
Peter Beverloo
lgtm https://codereview.chromium.org/2978603003/diff/20001/content/browser/background_fetch/background_fetch_data_manager.h File content/browser/background_fetch/background_fetch_data_manager.h (right): https://codereview.chromium.org/2978603003/diff/20001/content/browser/background_fetch/background_fetch_data_manager.h#newcode63 content/browser/background_fetch/background_fetch_data_manager.h:63: // started, and invokes the |callback| with that ...
3 years, 5 months ago (2017-07-12 13:30:50 UTC) #6
johnme
Addressed review comments - thanks :) https://codereview.chromium.org/2978603003/diff/20001/content/browser/background_fetch/background_fetch_data_manager.h File content/browser/background_fetch/background_fetch_data_manager.h (right): https://codereview.chromium.org/2978603003/diff/20001/content/browser/background_fetch/background_fetch_data_manager.h#newcode63 content/browser/background_fetch/background_fetch_data_manager.h:63: // started, and ...
3 years, 5 months ago (2017-07-12 14:13:58 UTC) #7
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2978603003/40001
3 years, 5 months ago (2017-07-12 14:14:15 UTC) #10
Dan Elphick
lgtm
3 years, 5 months ago (2017-07-12 14:18:51 UTC) #11
commit-bot: I haz the power
3 years, 5 months ago (2017-07-12 15:39:58 UTC) #15
Message was sent while issue was closed.
Committed patchset #3 (id:40001) as
https://chromium.googlesource.com/chromium/src/+/dd0e9b921a04328ae16ccba31883...

Powered by Google App Engine
This is Rietveld 408576698