| Index: components/offline_pages/background/offliner_policy.h
|
| diff --git a/components/offline_pages/background/offliner_policy.h b/components/offline_pages/background/offliner_policy.h
|
| index ee2cc0db615b05a614ff0ce23379ac3e1fa54196..972851f70891b586256f0dc40b468ce07cb14107 100644
|
| --- a/components/offline_pages/background/offliner_policy.h
|
| +++ b/components/offline_pages/background/offliner_policy.h
|
| @@ -36,22 +36,37 @@ class OfflinerPolicy {
|
| bool RetryCountIsMoreImportantThanRecency() { return true; }
|
|
|
| // The max number of times we will retry a request.
|
| - int GetMaxRetries() { return kMaxRetries; }
|
| + int GetMaxRetries() const { return kMaxRetries; }
|
| +
|
| + bool PowerRequiredForUserRequestedPage() const { return false; }
|
| +
|
| + bool PowerRequiredForNonUserRequestedPage() const { return true; }
|
| +
|
| + bool UnmeteredNetworkRequiredForUserRequestedPage() const { return false; }
|
| +
|
| + bool UnmeteredNetworkRequiredForNonUserRequestedPage() const { return true; }
|
| +
|
| + int BatteryPercentageRequiredForUserRequestedPage() const { return 50; }
|
| +
|
| + // This is so low because we require the device to be plugged in and charging.
|
| + // If we decide to allow non-user requested pages when not plugged in, we
|
| + // should raise this somewhat higher.
|
| + int BatteryPercentageRequiredForNonUserRequestedPage() const { return 25; }
|
|
|
| // How many seconds to keep trying new pages for, before we give up, and
|
| // return to the scheduler.
|
| - int GetBackgroundProcessingTimeBudgetSeconds() {
|
| + int GetBackgroundProcessingTimeBudgetSeconds() const {
|
| return kBackgroundTimeBudgetSeconds;
|
| }
|
|
|
| // How long do we allow a page to load before giving up on it
|
| - int GetSinglePageTimeBudgetInSeconds() {
|
| + int GetSinglePageTimeBudgetInSeconds() const {
|
| return kSinglePageTimeBudgetSeconds;
|
| }
|
|
|
| // How much battery must we have before fetching a page not explicitly
|
| // requested by the user?
|
| - int GetMinimumBatteryPercentageForNonUserRequestOfflining() {
|
| + int GetMinimumBatteryPercentageForNonUserRequestOfflining() const {
|
| return kMinimumBatteryPercentageForNonUserRequestOfflining;
|
| }
|
| };
|
|
|