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

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

Issue 2539263004: predictors: Take RESOURCE_TYPE_XHR into account. (Closed)
Patch Set: Add test. Created 4 years 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
« no previous file with comments | « no previous file | chrome/browser/predictors/resource_prefetch_predictor_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/predictors/resource_prefetch_predictor.cc
diff --git a/chrome/browser/predictors/resource_prefetch_predictor.cc b/chrome/browser/predictors/resource_prefetch_predictor.cc
index dcb8b8638b43acbb21e5ee9256a75ac9ffee9e7f..afa66a974aef95d32c6cff09539f77e841e9a2d1 100644
--- a/chrome/browser/predictors/resource_prefetch_predictor.cc
+++ b/chrome/browser/predictors/resource_prefetch_predictor.cc
@@ -217,11 +217,12 @@ bool ResourcePrefetchPredictor::IsHandledResourceType(
content::ResourceType ResourcePrefetchPredictor::GetResourceType(
content::ResourceType resource_type,
const std::string& mime_type) {
- // Restricts content::RESOURCE_TYPE_{PREFETCH,SUB_RESOURCE} to a small set of
- // mime types, because these resource types don't communicate how the
+ // Restricts content::RESOURCE_TYPE_{PREFETCH,SUB_RESOURCE,XHR} to a small set
+ // of mime types, because these resource types don't communicate how the
// resources will be used.
if (resource_type == content::RESOURCE_TYPE_PREFETCH ||
- resource_type == content::RESOURCE_TYPE_SUB_RESOURCE) {
+ resource_type == content::RESOURCE_TYPE_SUB_RESOURCE ||
+ resource_type == content::RESOURCE_TYPE_XHR) {
return GetResourceTypeFromMimeType(mime_type,
content::RESOURCE_TYPE_LAST_TYPE);
}
« no previous file with comments | « no previous file | chrome/browser/predictors/resource_prefetch_predictor_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698