| 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 render_frame_id == other.render_frame_id; | 196 render_frame_id == other.render_frame_id; |
| 197 } | 197 } |
| 198 | 198 |
| 199 ResourcePrefetchPredictorConfig::ResourcePrefetchPredictorConfig() | 199 ResourcePrefetchPredictorConfig::ResourcePrefetchPredictorConfig() |
| 200 : mode(0), | 200 : mode(0), |
| 201 max_navigation_lifetime_seconds(60), | 201 max_navigation_lifetime_seconds(60), |
| 202 max_urls_to_track(500), | 202 max_urls_to_track(500), |
| 203 max_hosts_to_track(200), | 203 max_hosts_to_track(200), |
| 204 min_url_visit_count(2), | 204 min_url_visit_count(2), |
| 205 max_resources_per_entry(50), | 205 max_resources_per_entry(50), |
| 206 max_redirects_per_entry(100), |
| 206 max_consecutive_misses(3), | 207 max_consecutive_misses(3), |
| 207 min_resource_confidence_to_trigger_prefetch(0.7f), | 208 min_resource_confidence_to_trigger_prefetch(0.7f), |
| 208 min_resource_hits_to_trigger_prefetch(2), | 209 min_resource_hits_to_trigger_prefetch(2), |
| 209 max_prefetches_inflight_per_navigation(24), | 210 max_prefetches_inflight_per_navigation(24), |
| 210 max_prefetches_inflight_per_host_per_navigation(3) { | 211 max_prefetches_inflight_per_host_per_navigation(3) {} |
| 211 } | |
| 212 | 212 |
| 213 ResourcePrefetchPredictorConfig::ResourcePrefetchPredictorConfig( | 213 ResourcePrefetchPredictorConfig::ResourcePrefetchPredictorConfig( |
| 214 const ResourcePrefetchPredictorConfig& other) = default; | 214 const ResourcePrefetchPredictorConfig& other) = default; |
| 215 | 215 |
| 216 ResourcePrefetchPredictorConfig::~ResourcePrefetchPredictorConfig() { | 216 ResourcePrefetchPredictorConfig::~ResourcePrefetchPredictorConfig() { |
| 217 } | 217 } |
| 218 | 218 |
| 219 bool ResourcePrefetchPredictorConfig::IsLearningEnabled() const { | 219 bool ResourcePrefetchPredictorConfig::IsLearningEnabled() const { |
| 220 return IsURLLearningEnabled() || IsHostLearningEnabled(); | 220 return IsURLLearningEnabled() || IsHostLearningEnabled(); |
| 221 } | 221 } |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 269 | 269 |
| 270 bool ResourcePrefetchPredictorConfig::IsMoreResourcesEnabledForTest() const { | 270 bool ResourcePrefetchPredictorConfig::IsMoreResourcesEnabledForTest() const { |
| 271 return max_resources_per_entry == 100; | 271 return max_resources_per_entry == 100; |
| 272 } | 272 } |
| 273 | 273 |
| 274 bool ResourcePrefetchPredictorConfig::IsSmallDBEnabledForTest() const { | 274 bool ResourcePrefetchPredictorConfig::IsSmallDBEnabledForTest() const { |
| 275 return max_urls_to_track == 200 && max_hosts_to_track == 100; | 275 return max_urls_to_track == 200 && max_hosts_to_track == 100; |
| 276 } | 276 } |
| 277 | 277 |
| 278 } // namespace predictors | 278 } // namespace predictors |
| OLD | NEW |