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

Unified Diff: components/offline_pages/background/request_coordinator.h

Issue 2493683002: [OfflinePages] Fixes RequestCoordinator bug not clearing state on timeout (Closed)
Patch Set: Broke out some OfflinerDoneCallback logic and reworked timeout handling Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/offline_pages/background/request_coordinator.h
diff --git a/components/offline_pages/background/request_coordinator.h b/components/offline_pages/background/request_coordinator.h
index a812c6a4d8bfde5d680d5e264eaea3e4581fcf5d..0d68901d0bdbc477029e725fd6d1f3351f63f0e5 100644
--- a/components/offline_pages/background/request_coordinator.h
+++ b/components/offline_pages/background/request_coordinator.h
@@ -302,14 +302,23 @@ class RequestCoordinator : public KeyedService,
void OfflinerDoneCallback(const SavePageRequest& request,
Offliner::RequestStatus status);
+ // Records a completed attempt for the request and update it in the queue
+ // (possibly removing it).
+ void UpdateRequestForCompletedAttempt(const SavePageRequest& request,
+ Offliner::RequestStatus status);
+
+ // Returns whether we should try another request based on the outcome
+ // of the previous one.
+ bool ShouldTryNextRequest(Offliner::RequestStatus previous_request_status);
+
void TryNextRequest();
// If there is an active request in the list, cancel that request.
bool CancelActiveRequestIfItMatches(const std::vector<int64_t>& request_ids);
// Records an aborted attempt for the request and update it in the queue
- // (possibly removing it). Returns the updated copy.
- void AbortRequestAttempt(const SavePageRequest& request);
+ // (possibly removing it).
+ void UpdateRequestForAbortedAttempt(const SavePageRequest& request);
// Remove the attempted request from the queue with status to pass through to
// any observers and UMA histogram.

Powered by Google App Engine
This is Rietveld 408576698