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

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

Issue 2196293002: Skips processing more SavePageLater requests in current processing window when one completes unsucc… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: DCHECK in default case 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
« no previous file with comments | « no previous file | components/offline_pages/background/request_coordinator_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 5876d8386d79b7c3834f6cf9b7d72bd22f8c38cd..68551e273d06c55ef526f9d609b50e744f240a3d 100644
--- a/components/offline_pages/background/request_coordinator.cc
+++ b/components/offline_pages/background/request_coordinator.cc
@@ -228,7 +228,28 @@ void RequestCoordinator::OfflinerDoneCallback(const SavePageRequest& request,
weak_ptr_factory_.GetWeakPtr()));
}
- TryNextRequest();
+ // 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::PRERENDERING_CANCELED:
+ // Consider processing another request in this service window.
+ TryNextRequest();
+ break;
+ case Offliner::RequestStatus::FOREGROUND_CANCELED:
fgorski 2016/08/03 16:18:59 I think you might be missing UNKNOWN and LOADED.
dougarnett 2016/08/03 16:44:08 Right, actually intentional here as those are inte
+ case Offliner::RequestStatus::PRERENDERING_FAILED:
+ // No further processing in this service window.
+ break;
+ default:
+ // Make explicit choice about new status codes that actually reach here.
+ // Their default is no further processing in this service window.
+ DCHECK(false);
+ }
}
const Scheduler::TriggerConditions
« no previous file with comments | « no previous file | components/offline_pages/background/request_coordinator_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698