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

Unified Diff: chrome/browser/predictors/resource_prefetch_predictor_tables.cc

Issue 2184323003: predictors: Support fonts in resource_prefetch_predictors. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/predictors/resource_prefetch_predictor_tables.cc
diff --git a/chrome/browser/predictors/resource_prefetch_predictor_tables.cc b/chrome/browser/predictors/resource_prefetch_predictor_tables.cc
index c8093252e066a9b3ad6920b54427df3243508354..5a69a9a4b54f3fe162d572615bcefa5b27386db8 100644
--- a/chrome/browser/predictors/resource_prefetch_predictor_tables.cc
+++ b/chrome/browser/predictors/resource_prefetch_predictor_tables.cc
@@ -104,13 +104,14 @@ ResourcePrefetchPredictorTables::ResourceRow::ResourceRow(
}
void ResourcePrefetchPredictorTables::ResourceRow::UpdateScore() {
- // The score is calculated so that when the rows are sorted, the stylesheets
- // and scripts appear first, sorted by position(ascending) and then the rest
- // of the resources sorted by position(ascending).
+ // The score is calculated so that when the rows are sorted, stylesheets,
+ // scripts and fonts appear first, sorted by position(ascending) and then the
+ // rest of the resources sorted by position (ascending).
static const int kMaxResourcesPerType = 100;
switch (resource_type) {
case content::RESOURCE_TYPE_STYLESHEET:
case content::RESOURCE_TYPE_SCRIPT:
+ case content::RESOURCE_TYPE_FONT_RESOURCE:
score = (2 * kMaxResourcesPerType) - average_position;
break;

Powered by Google App Engine
This is Rietveld 408576698