Index: components/offline_pages/background/request_picker.cc |
diff --git a/components/offline_pages/background/request_picker.cc b/components/offline_pages/background/request_picker.cc |
index 23fee192c99f27f8152c66bdb61bc5ae6dfc8664..42c497c84f47e3632c0ccd5e5aefdecb254ff31c 100644 |
--- a/components/offline_pages/background/request_picker.cc |
+++ b/components/offline_pages/background/request_picker.cc |
@@ -114,6 +114,12 @@ bool RequestPicker::RequestConditionsSatisfied(const SavePageRequest& request) { |
if (request.attempt_count() >= policy_->GetMaxRetries()) |
return false; |
+ // If the request is expired, do not consider it. |
+ base::TimeDelta requestAge = base::Time::Now() - request.creation_time(); |
+ if (requestAge > |
+ base::TimeDelta::FromSeconds(policy_->GetPageExpirationTimeInSeconds())) |
+ return false; |
dougarnett
2016/07/27 15:40:41
Maybe add TODO wrt need to remove this from the qu
Pete Williamson
2016/07/27 17:20:06
Done.
|
+ |
// If this request is not active yet, return false. |
// TODO(petewil): If the only reason we return nothing to do is that we have |
// inactive requests, we still want to try again later after their activation |