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

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

Issue 2493683002: [OfflinePages] Fixes RequestCoordinator bug not clearing state on timeout (Closed)
Patch Set: 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
« 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 93e127d3e59d00414187cfcac3176ef5b2eae8f1..7807e953a24994b60cec008464af2d831168d159 100644
--- a/components/offline_pages/background/request_coordinator.cc
+++ b/components/offline_pages/background/request_coordinator.cc
@@ -241,13 +241,11 @@ void RequestCoordinator::StopPrerendering(Offliner::RequestStatus stop_status) {
DCHECK(active_request_.get());
offliner_->Cancel();
- // If we timed out, let the offliner done callback handle it.
- if (stop_status == Offliner::RequestStatus::REQUEST_COORDINATOR_TIMED_OUT)
- return;
-
- // Otherwise, this attempt never really had a chance to run, mark it
- // aborted.
- AbortRequestAttempt(active_request_.get());
+ if (stop_status != Offliner::RequestStatus::REQUEST_COORDINATOR_TIMED_OUT) {
+ // Since not a timeout, consider that the current attempt never had a
+ // chance to complete, mark it aborted.
+ AbortRequestAttempt(active_request_.get());
Pete Williamson 2016/11/10 01:03:30 When we get a timeout like this, we should get the
dougarnett 2016/11/10 16:38:38 Offliner::Cancel contract is to not call the callb
Pete Williamson 2016/11/10 19:01:29 OK, in that case, it is my misunderstanding of the
+ }
}
// Stopping offliner means it will not call callback so set last status.
« 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