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

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

Issue 2294933003: [Offline Pages] Handle prerender FinalStatus UnsupportedScheme as a cancel rather than failure. (Closed)
Patch Set: Revert started try count change from this cl and added TODO with followup bug id. Created 4 years, 4 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 eacb00221009df4eeca1e514f9c06029f819cf5d..d6fc9858312ded63053eb3844293a68d5ec9bab4 100644
--- a/components/offline_pages/background/request_coordinator.cc
+++ b/components/offline_pages/background/request_coordinator.cc
@@ -406,7 +406,8 @@ void RequestCoordinator::OfflinerDoneCallback(const SavePageRequest& request,
is_busy_ = false;
active_request_.reset(nullptr);
- if (status == Offliner::RequestStatus::FOREGROUND_CANCELED) {
+ if (status == Offliner::RequestStatus::FOREGROUND_CANCELED ||
+ status == Offliner::RequestStatus::PRERENDERING_CANCELED) {
// Update the request for the canceled attempt.
// TODO(dougarnett): See if we can conclusively identify other attempt
// aborted cases to treat this way (eg, for Render Process Killed).
@@ -416,7 +417,11 @@ void RequestCoordinator::OfflinerDoneCallback(const SavePageRequest& request,
base::Bind(&RequestCoordinator::UpdateRequestCallback,
weak_ptr_factory_.GetWeakPtr(),
updated_request.client_id()));
- NotifyCompleted(updated_request, SavePageStatus::FOREGROUND_CANCELED);
+ SavePageStatus notify_status =
+ (status == Offliner::RequestStatus::FOREGROUND_CANCELED)
+ ? SavePageStatus::FOREGROUND_CANCELED
+ : SavePageStatus::PRERENDER_CANCELED;
+ NotifyCompleted(updated_request, notify_status);
} else if (status == Offliner::RequestStatus::SAVED) {
// Remove the request from the queue if it succeeded.
@@ -459,11 +464,11 @@ void RequestCoordinator::OfflinerDoneCallback(const SavePageRequest& request,
case Offliner::RequestStatus::SAVED:
case Offliner::RequestStatus::SAVE_FAILED:
case Offliner::RequestStatus::REQUEST_COORDINATOR_CANCELED: // timeout
- case Offliner::RequestStatus::PRERENDERING_CANCELED:
// Consider processing another request in this service window.
TryNextRequest();
break;
case Offliner::RequestStatus::FOREGROUND_CANCELED:
+ case Offliner::RequestStatus::PRERENDERING_CANCELED:
case Offliner::RequestStatus::PRERENDERING_FAILED:
// No further processing in this service window.
break;

Powered by Google App Engine
This is Rietveld 408576698