Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(22)

Side by Side Diff: chrome/browser/predictors/resource_prefetch_common.cc

Issue 2796783004: predictors: Add origin learning. (Closed)
Patch Set: , Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 return tab_id == rhs.tab_id && main_frame_url == rhs.main_frame_url; 130 return tab_id == rhs.tab_id && main_frame_url == rhs.main_frame_url;
131 } 131 }
132 132
133 ResourcePrefetchPredictorConfig::ResourcePrefetchPredictorConfig() 133 ResourcePrefetchPredictorConfig::ResourcePrefetchPredictorConfig()
134 : mode(0), 134 : mode(0),
135 max_navigation_lifetime_seconds(60), 135 max_navigation_lifetime_seconds(60),
136 max_urls_to_track(500), 136 max_urls_to_track(500),
137 max_hosts_to_track(200), 137 max_hosts_to_track(200),
138 min_url_visit_count(2), 138 min_url_visit_count(2),
139 max_resources_per_entry(50), 139 max_resources_per_entry(50),
140 max_origins_per_entry(50),
140 max_consecutive_misses(3), 141 max_consecutive_misses(3),
141 min_resource_confidence_to_trigger_prefetch(0.7f), 142 min_resource_confidence_to_trigger_prefetch(0.7f),
142 min_resource_hits_to_trigger_prefetch(2), 143 min_resource_hits_to_trigger_prefetch(2),
143 max_prefetches_inflight_per_navigation(5), 144 max_prefetches_inflight_per_navigation(5),
144 max_prefetches_inflight_per_host_per_navigation(3), 145 max_prefetches_inflight_per_host_per_navigation(3),
145 is_url_learning_enabled(false), 146 is_url_learning_enabled(false),
146 is_manifests_enabled(false) {} 147 is_manifests_enabled(false),
148 is_origin_prediction_enabled(false) {}
147 149
148 ResourcePrefetchPredictorConfig::ResourcePrefetchPredictorConfig( 150 ResourcePrefetchPredictorConfig::ResourcePrefetchPredictorConfig(
149 const ResourcePrefetchPredictorConfig& other) = default; 151 const ResourcePrefetchPredictorConfig& other) = default;
150 152
151 ResourcePrefetchPredictorConfig::~ResourcePrefetchPredictorConfig() { 153 ResourcePrefetchPredictorConfig::~ResourcePrefetchPredictorConfig() {
152 } 154 }
153 155
154 bool ResourcePrefetchPredictorConfig::IsLearningEnabled() const { 156 bool ResourcePrefetchPredictorConfig::IsLearningEnabled() const {
155 return (mode & LEARNING) > 0; 157 return (mode & LEARNING) > 0;
156 } 158 }
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 192
191 bool ResourcePrefetchPredictorConfig::IsMoreResourcesEnabledForTest() const { 193 bool ResourcePrefetchPredictorConfig::IsMoreResourcesEnabledForTest() const {
192 return max_resources_per_entry == 100; 194 return max_resources_per_entry == 100;
193 } 195 }
194 196
195 bool ResourcePrefetchPredictorConfig::IsSmallDBEnabledForTest() const { 197 bool ResourcePrefetchPredictorConfig::IsSmallDBEnabledForTest() const {
196 return max_urls_to_track == 200 && max_hosts_to_track == 100; 198 return max_urls_to_track == 200 && max_hosts_to_track == 100;
197 } 199 }
198 200
199 } // namespace predictors 201 } // namespace predictors
OLDNEW
« no previous file with comments | « chrome/browser/predictors/resource_prefetch_common.h ('k') | chrome/browser/predictors/resource_prefetch_common_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698