OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #include "chrome/browser/predictors/resource_prefetch_common.h" | 5 #include "chrome/browser/predictors/resource_prefetch_common.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <tuple> | 8 #include <tuple> |
9 | 9 |
10 #include "base/metrics/field_trial_params.h" | 10 #include "base/metrics/field_trial_params.h" |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 } | 126 } |
127 | 127 |
128 ResourcePrefetchPredictorConfig::ResourcePrefetchPredictorConfig() | 128 ResourcePrefetchPredictorConfig::ResourcePrefetchPredictorConfig() |
129 : mode(0), | 129 : mode(0), |
130 max_navigation_lifetime_seconds(60), | 130 max_navigation_lifetime_seconds(60), |
131 max_urls_to_track(500), | 131 max_urls_to_track(500), |
132 max_hosts_to_track(200), | 132 max_hosts_to_track(200), |
133 min_url_visit_count(2), | 133 min_url_visit_count(2), |
134 max_resources_per_entry(50), | 134 max_resources_per_entry(50), |
135 max_consecutive_misses(3), | 135 max_consecutive_misses(3), |
| 136 max_redirect_consecutive_misses(5), |
136 min_resource_confidence_to_trigger_prefetch(0.7f), | 137 min_resource_confidence_to_trigger_prefetch(0.7f), |
137 min_resource_hits_to_trigger_prefetch(2), | 138 min_resource_hits_to_trigger_prefetch(2), |
138 max_prefetches_inflight_per_navigation(5), | 139 max_prefetches_inflight_per_navigation(5), |
139 max_prefetches_inflight_per_host_per_navigation(3), | 140 max_prefetches_inflight_per_host_per_navigation(3), |
140 is_url_learning_enabled(false) { | 141 is_url_learning_enabled(false) {} |
141 } | |
142 | 142 |
143 ResourcePrefetchPredictorConfig::ResourcePrefetchPredictorConfig( | 143 ResourcePrefetchPredictorConfig::ResourcePrefetchPredictorConfig( |
144 const ResourcePrefetchPredictorConfig& other) = default; | 144 const ResourcePrefetchPredictorConfig& other) = default; |
145 | 145 |
146 ResourcePrefetchPredictorConfig::~ResourcePrefetchPredictorConfig() { | 146 ResourcePrefetchPredictorConfig::~ResourcePrefetchPredictorConfig() { |
147 } | 147 } |
148 | 148 |
149 bool ResourcePrefetchPredictorConfig::IsLearningEnabled() const { | 149 bool ResourcePrefetchPredictorConfig::IsLearningEnabled() const { |
150 return (mode & LEARNING) > 0; | 150 return (mode & LEARNING) > 0; |
151 } | 151 } |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 | 185 |
186 bool ResourcePrefetchPredictorConfig::IsMoreResourcesEnabledForTest() const { | 186 bool ResourcePrefetchPredictorConfig::IsMoreResourcesEnabledForTest() const { |
187 return max_resources_per_entry == 100; | 187 return max_resources_per_entry == 100; |
188 } | 188 } |
189 | 189 |
190 bool ResourcePrefetchPredictorConfig::IsSmallDBEnabledForTest() const { | 190 bool ResourcePrefetchPredictorConfig::IsSmallDBEnabledForTest() const { |
191 return max_urls_to_track == 200 && max_hosts_to_track == 100; | 191 return max_urls_to_track == 200 && max_hosts_to_track == 100; |
192 } | 192 } |
193 | 193 |
194 } // namespace predictors | 194 } // namespace predictors |
OLD | NEW |