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

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

Issue 2729763002: [Offline Pages] Pick correct request when resuming. (Closed)
Patch Set: Moving logic to pick_request_task. Created 3 years, 10 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/core/background/request_coordinator.cc
diff --git a/components/offline_pages/core/background/request_coordinator.cc b/components/offline_pages/core/background/request_coordinator.cc
index 5a363c0a8b056e1a7edc003e0180e37577d5891b..7890914641a7f9b093a94e8deb5fde97619b5e51 100644
--- a/components/offline_pages/core/background/request_coordinator.cc
+++ b/components/offline_pages/core/background/request_coordinator.cc
@@ -425,6 +425,8 @@ void RequestCoordinator::PauseRequests(
void RequestCoordinator::ResumeRequests(
const std::vector<int64_t>& request_ids) {
+ std::copy(request_ids.begin(), request_ids.end(),
+ std::back_inserter(priortized_requests_));
Pete Williamson 2017/03/06 18:30:57 After thinking about it a bit, I think the user wi
romax 2017/03/07 18:40:44 Done.
queue_->ChangeRequestsState(
request_ids, SavePageRequest::RequestState::AVAILABLE,
base::Bind(&RequestCoordinator::UpdateMultipleRequestsCallback,
@@ -685,16 +687,17 @@ void RequestCoordinator::TryNextRequest(bool is_start_of_processing) {
return;
}
- // Ask request queue to make a new PickRequestTask object, then put it on the
- // task queue.
+ // Ask request queue to make a new PickRequestTask object, then put it on
+ // the task queue.
queue_->PickNextRequest(
- policy_.get(), base::Bind(&RequestCoordinator::RequestPicked,
- weak_ptr_factory_.GetWeakPtr()),
+ policy_.get(),
+ base::Bind(&RequestCoordinator::RequestPicked,
+ weak_ptr_factory_.GetWeakPtr()),
base::Bind(&RequestCoordinator::RequestNotPicked,
weak_ptr_factory_.GetWeakPtr()),
base::Bind(&RequestCoordinator::RequestCounts,
weak_ptr_factory_.GetWeakPtr(), is_start_of_processing),
- *current_conditions_.get(), disabled_requests_);
+ *current_conditions_.get(), disabled_requests_, priortized_requests_);
// TODO(petewil): Verify current_conditions has a good value on all calling
// paths. It is really more of a "last known conditions" than "current
// conditions". Consider having a call to Java to check the current

Powered by Google App Engine
This is Rietveld 408576698