| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef COMPONENTS_OFFLINE_PAGES_CORE_BACKGROUND_OFFLINER_POLICY_H_ | 5 #ifndef COMPONENTS_OFFLINE_PAGES_CORE_BACKGROUND_OFFLINER_POLICY_H_ |
| 6 #define COMPONENTS_OFFLINE_PAGES_CORE_BACKGROUND_OFFLINER_POLICY_H_ | 6 #define COMPONENTS_OFFLINE_PAGES_CORE_BACKGROUND_OFFLINER_POLICY_H_ |
| 7 | 7 |
| 8 namespace { | 8 namespace { |
| 9 // The max number of started tries is to guard against pages that make the | 9 // The max number of started tries is to guard against pages that make the |
| 10 // prerenderer crash. It should be greater than or equal to the max number of | 10 // prerenderer crash. It should be greater than or equal to the max number of |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 : prefer_untried_requests_(prefer_untried), | 59 : prefer_untried_requests_(prefer_untried), |
| 60 prefer_earlier_requests_(prefer_earlier), | 60 prefer_earlier_requests_(prefer_earlier), |
| 61 retry_count_is_more_important_than_recency_(prefer_retry_count), | 61 retry_count_is_more_important_than_recency_(prefer_retry_count), |
| 62 max_started_tries_(max_started_tries), | 62 max_started_tries_(max_started_tries), |
| 63 max_completed_tries_(max_completed_tries), | 63 max_completed_tries_(max_completed_tries), |
| 64 background_scheduled_processing_time_budget_( | 64 background_scheduled_processing_time_budget_( |
| 65 background_processing_time_budget) {} | 65 background_processing_time_budget) {} |
| 66 | 66 |
| 67 // TODO(petewil): Numbers here are chosen arbitrarily, do the proper studies | 67 // TODO(petewil): Numbers here are chosen arbitrarily, do the proper studies |
| 68 // to get good policy numbers. Eventually this should get data from a finch | 68 // to get good policy numbers. Eventually this should get data from a finch |
| 69 // experiment. | 69 // experiment. crbug.com/705112. |
| 70 | 70 |
| 71 // Returns true if we should prefer retrying lesser tried requests. | 71 // Returns true if we should prefer retrying lesser tried requests. |
| 72 bool ShouldPreferUntriedRequests() const { return prefer_untried_requests_; } | 72 bool ShouldPreferUntriedRequests() const { return prefer_untried_requests_; } |
| 73 | 73 |
| 74 // Returns true if we should prefer older requests of equal number of tries. | 74 // Returns true if we should prefer older requests of equal number of tries. |
| 75 bool ShouldPreferEarlierRequests() const { return prefer_earlier_requests_; } | 75 bool ShouldPreferEarlierRequests() const { return prefer_earlier_requests_; } |
| 76 | 76 |
| 77 // Returns true if retry count is considered more important than recency in | 77 // Returns true if retry count is considered more important than recency in |
| 78 // picking which request to try next. | 78 // picking which request to try next. |
| 79 bool RetryCountIsMoreImportantThanRecency() const { | 79 bool RetryCountIsMoreImportantThanRecency() const { |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 bool prefer_untried_requests_; | 139 bool prefer_untried_requests_; |
| 140 bool prefer_earlier_requests_; | 140 bool prefer_earlier_requests_; |
| 141 bool retry_count_is_more_important_than_recency_; | 141 bool retry_count_is_more_important_than_recency_; |
| 142 int max_started_tries_; | 142 int max_started_tries_; |
| 143 int max_completed_tries_; | 143 int max_completed_tries_; |
| 144 int background_scheduled_processing_time_budget_; | 144 int background_scheduled_processing_time_budget_; |
| 145 }; | 145 }; |
| 146 } // namespace offline_pages | 146 } // namespace offline_pages |
| 147 | 147 |
| 148 #endif // COMPONENTS_OFFLINE_PAGES_CORE_BACKGROUND_OFFLINER_POLICY_H_ | 148 #endif // COMPONENTS_OFFLINE_PAGES_CORE_BACKGROUND_OFFLINER_POLICY_H_ |
| OLD | NEW |