| 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 <stdlib.h> | 7 #include <stdlib.h> |
| 8 #include <tuple> | 8 #include <tuple> |
| 9 | 9 |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 max_hosts_to_track(200), | 196 max_hosts_to_track(200), |
| 197 min_url_visit_count(2), | 197 min_url_visit_count(2), |
| 198 max_resources_per_entry(50), | 198 max_resources_per_entry(50), |
| 199 max_consecutive_misses(3), | 199 max_consecutive_misses(3), |
| 200 min_resource_confidence_to_trigger_prefetch(0.7f), | 200 min_resource_confidence_to_trigger_prefetch(0.7f), |
| 201 min_resource_hits_to_trigger_prefetch(2), | 201 min_resource_hits_to_trigger_prefetch(2), |
| 202 max_prefetches_inflight_per_navigation(24), | 202 max_prefetches_inflight_per_navigation(24), |
| 203 max_prefetches_inflight_per_host_per_navigation(3) { | 203 max_prefetches_inflight_per_host_per_navigation(3) { |
| 204 } | 204 } |
| 205 | 205 |
| 206 ResourcePrefetchPredictorConfig::ResourcePrefetchPredictorConfig( |
| 207 const ResourcePrefetchPredictorConfig& other) = default; |
| 208 |
| 206 ResourcePrefetchPredictorConfig::~ResourcePrefetchPredictorConfig() { | 209 ResourcePrefetchPredictorConfig::~ResourcePrefetchPredictorConfig() { |
| 207 } | 210 } |
| 208 | 211 |
| 209 bool ResourcePrefetchPredictorConfig::IsLearningEnabled() const { | 212 bool ResourcePrefetchPredictorConfig::IsLearningEnabled() const { |
| 210 return IsURLLearningEnabled() || IsHostLearningEnabled(); | 213 return IsURLLearningEnabled() || IsHostLearningEnabled(); |
| 211 } | 214 } |
| 212 | 215 |
| 213 bool ResourcePrefetchPredictorConfig::IsPrefetchingEnabled( | 216 bool ResourcePrefetchPredictorConfig::IsPrefetchingEnabled( |
| 214 Profile* profile) const { | 217 Profile* profile) const { |
| 215 return IsURLPrefetchingEnabled(profile) || IsHostPrefetchingEnabled(profile); | 218 return IsURLPrefetchingEnabled(profile) || IsHostPrefetchingEnabled(profile); |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 259 | 262 |
| 260 bool ResourcePrefetchPredictorConfig::IsMoreResourcesEnabledForTest() const { | 263 bool ResourcePrefetchPredictorConfig::IsMoreResourcesEnabledForTest() const { |
| 261 return max_resources_per_entry == 100; | 264 return max_resources_per_entry == 100; |
| 262 } | 265 } |
| 263 | 266 |
| 264 bool ResourcePrefetchPredictorConfig::IsSmallDBEnabledForTest() const { | 267 bool ResourcePrefetchPredictorConfig::IsSmallDBEnabledForTest() const { |
| 265 return max_urls_to_track == 200 && max_hosts_to_track == 100; | 268 return max_urls_to_track == 200 && max_hosts_to_track == 100; |
| 266 } | 269 } |
| 267 | 270 |
| 268 } // namespace predictors | 271 } // namespace predictors |
| OLD | NEW |