| 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 d5e87d26a47a8fd93aa7af30aa2dacef1ad23837..ea3097a0c7d5238d18cfb4693865b770cd66ffb7 100644
|
| --- a/components/offline_pages/background/request_coordinator.cc
|
| +++ b/components/offline_pages/background/request_coordinator.cc
|
| @@ -13,11 +13,19 @@
|
| #include "components/offline_pages/background/offliner_policy.h"
|
| #include "components/offline_pages/background/request_picker.h"
|
| #include "components/offline_pages/background/save_page_request.h"
|
| -#include "components/offline_pages/background/scheduler.h"
|
| #include "components/offline_pages/offline_page_item.h"
|
|
|
| namespace offline_pages {
|
|
|
| +namespace {
|
| +// TODO(dougarnett/petewil): Move to Policy object. Also consider lower minimum
|
| +// battery percentage once there is some processing time limits in place.
|
| +const Scheduler::TriggerConditions kUserRequestTriggerConditions(
|
| + false /* require_power_connected */,
|
| + 50 /* minimum_battery_percentage */,
|
| + false /* require_unmetered_network */);
|
| +} // namespace
|
| +
|
| RequestCoordinator::RequestCoordinator(std::unique_ptr<OfflinerPolicy> policy,
|
| std::unique_ptr<OfflinerFactory> factory,
|
| std::unique_ptr<RequestQueue> queue,
|
| @@ -63,9 +71,8 @@ void RequestCoordinator::AddRequestResultCallback(
|
| const SavePageRequest& request) {
|
|
|
| // Inform the scheduler that we have an outstanding task.
|
| - // TODO(petewil): Define proper TriggerConditions and set them.
|
| - Scheduler::TriggerCondition conditions;
|
| - scheduler_->Schedule(conditions);
|
| + // TODO(petewil): Determine trigger conditions from policy.
|
| + scheduler_->Schedule(GetTriggerConditionsForUserRequest());
|
| }
|
|
|
| // Called in response to updating a request in the request queue.
|
| @@ -114,6 +121,11 @@ void RequestCoordinator::TryNextRequest() {
|
| void RequestCoordinator::StopProcessing() {
|
| }
|
|
|
| +Scheduler::TriggerConditions const&
|
| +RequestCoordinator::GetTriggerConditionsForUserRequest() {
|
| + return kUserRequestTriggerConditions;
|
| +}
|
| +
|
| void RequestCoordinator::SendRequestToOffliner(const SavePageRequest& request) {
|
| // TODO(petewil): Ensure only one offliner at a time is used.
|
| // TODO(petewil): When we have multiple offliners, we need to pick one.
|
|
|