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

Unified Diff: chrome/browser/predictors/resource_prefetch_predictor.h

Issue 2184323003: predictors: Support fonts in resource_prefetch_predictors. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments. 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.h
diff --git a/chrome/browser/predictors/resource_prefetch_predictor.h b/chrome/browser/predictors/resource_prefetch_predictor.h
index a42124120e782f55e511df8121da8877e1ac41cb..238a322738e6e2d1529a8b88fe2c98e5ff730a6d 100644
--- a/chrome/browser/predictors/resource_prefetch_predictor.h
+++ b/chrome/browser/predictors/resource_prefetch_predictor.h
@@ -145,6 +145,7 @@ class ResourcePrefetchPredictor
FRIEND_TEST_ALL_PREFIXES(ResourcePrefetchPredictorTest,
OnSubresourceResponse);
FRIEND_TEST_ALL_PREFIXES(ResourcePrefetchPredictorTest, GetCorrectPLT);
+ FRIEND_TEST_ALL_PREFIXES(ResourcePrefetchPredictorTest, HandledResourceTypes);
enum InitializationState {
NOT_INITIALIZED = 0,
@@ -178,7 +179,12 @@ class ResourcePrefetchPredictor
static bool IsHandledMainPage(net::URLRequest* request);
// Returns true if the subresource request is supported for prediction.
- static bool IsHandledSubresource(net::URLRequest* request);
+ static bool IsHandledSubresource(net::URLRequest* request,
+ content::ResourceType resource_type);
+
+ // Returns true if the subresource has a supported type.
+ static bool IsHandledResourceType(content::ResourceType resource_type,
+ const std::string& mime_type);
// Returns true if the request (should have a response in it) is cacheable.
static bool IsCacheable(const net::URLRequest* request);

Powered by Google App Engine
This is Rietveld 408576698