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

Unified Diff: components/offline_pages/background/request_picker.h

Issue 2233493003: [Offline Pages] Remove expired requests from the queue. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixing patching error. 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_picker.h
diff --git a/components/offline_pages/background/request_picker.h b/components/offline_pages/background/request_picker.h
index 3062152ed57e2a5fc6775eb4ec927d365a6d4a1d..d4d77cee3f6c6011aa682c25a6f901130ff765ca 100644
--- a/components/offline_pages/background/request_picker.h
+++ b/components/offline_pages/background/request_picker.h
@@ -20,7 +20,9 @@ typedef bool (RequestPicker::*RequestCompareFunction)(
class RequestPicker {
public:
- RequestPicker(RequestQueue* requestQueue, OfflinerPolicy* policy);
+ RequestPicker(RequestQueue* requestQueue,
+ OfflinerPolicy* policy,
+ RequestCoordinator* coordinator);
~RequestPicker();
@@ -63,10 +65,21 @@ class RequestPicker {
int CompareCreationTime(const SavePageRequest* left,
const SavePageRequest* right);
- // unowned pointer to the request queue.
+ // Split all requests into expired ones and still valid ones.
+ void SplitRequests(const std::vector<SavePageRequest>& requests,
+ std::vector<SavePageRequest>& valid_requests,
+ std::vector<SavePageRequest>& expired_requests);
+
+ // Callback used after requests get expired.
+ void OnRequestExpired(const std::vector<SavePageRequest>& expired_request,
+ RequestQueue::UpdateRequestResult result);
+
+ // Unowned pointer to the request queue.
RequestQueue* queue_;
- // unowned pointer to the policy object.
+ // Unowned pointer to the policy object.
OfflinerPolicy* policy_;
+ // Unowned pointer to the request coordinator.
+ RequestCoordinator* coordinator_;
// Current conditions on the device
std::unique_ptr<DeviceConditions> current_conditions_;
// True if we prefer less-tried requests

Powered by Google App Engine
This is Rietveld 408576698