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

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

Issue 2361883002: [Offline Pages] Adds classification of some prerender FinalStatus codes as canceled operations or a… (Closed)
Patch Set: Reworked per feedback Created 4 years, 3 months 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.cc
diff --git a/components/offline_pages/background/request_coordinator.cc b/components/offline_pages/background/request_coordinator.cc
index 814263ae519a46da9947527e5237226f06386109..63998097ffc24372403df1f894371c18a7c9d418 100644
--- a/components/offline_pages/background/request_coordinator.cc
+++ b/components/offline_pages/background/request_coordinator.cc
@@ -528,6 +528,9 @@ void RequestCoordinator::OfflinerDoneCallback(const SavePageRequest& request,
} else if (status == Offliner::RequestStatus::SAVED) {
// Remove the request from the queue if it succeeded.
RemoveAttemptedRequest(request, BackgroundSavePageResult::SUCCESS);
+ } else if (status == Offliner::RequestStatus::PRERENDERING_FAILED_NO_RETRY) {
+ RemoveAttemptedRequest(request,
+ BackgroundSavePageResult::PRERENDER_FAILURE);
} else if (request.completed_attempt_count() + 1 >=
policy_->GetMaxCompletedTries()) {
// Remove from the request queue if we exceeded max retries. The +1
@@ -553,13 +556,12 @@ void RequestCoordinator::OfflinerDoneCallback(const SavePageRequest& request,
// Determine whether we might try another request in this
// processing window based on how the previous request completed.
- //
- // TODO(dougarnett): Need to split PRERENDERING_FAILED into separate
- // codes as to whether we should try another request or not.
switch (status) {
case Offliner::RequestStatus::SAVED:
case Offliner::RequestStatus::SAVE_FAILED:
- case Offliner::RequestStatus::REQUEST_COORDINATOR_CANCELED: // timeout
+ case Offliner::RequestStatus::REQUEST_COORDINATOR_CANCELED:
+ case Offliner::RequestStatus::REQUEST_COORDINATOR_TIMED_OUT:
+ case Offliner::RequestStatus::PRERENDERING_FAILED_NO_RETRY:
// Consider processing another request in this service window.
TryNextRequest();
break;

Powered by Google App Engine
This is Rietveld 408576698