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

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

Issue 2260573002: predictors: Track whether resources have validators, and require validation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Make Visual Studio happy. Created 4 years, 4 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
« no previous file with comments | « no previous file | chrome/browser/predictors/resource_prefetch_predictor.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.h
diff --git a/chrome/browser/predictors/resource_prefetch_predictor.h b/chrome/browser/predictors/resource_prefetch_predictor.h
index 3c055a331f4fbdd20af1e9c375627e98caf2c13e..1b0253e178736750b56c737905c5443ca14dab51 100644
--- a/chrome/browser/predictors/resource_prefetch_predictor.h
+++ b/chrome/browser/predictors/resource_prefetch_predictor.h
@@ -90,6 +90,9 @@ class ResourcePrefetchPredictor
bool was_cached;
GURL redirect_url; // Empty unless request was redirected to a valid url.
+ bool has_validators;
+ bool always_revalidate;
+
// Initializes a |URLRequestSummary| from a |URLRequest| response.
// Returns true for success.
static bool SummarizeResponse(const net::URLRequest& request,
@@ -106,6 +109,12 @@ class ResourcePrefetchPredictor
static bool ShouldRecordResponse(net::URLRequest* response);
static bool ShouldRecordRedirect(net::URLRequest* response);
+ // Determines the resource type from the declared one, falling back to MIME
+ // type detection when it is not explicit.
+ static content::ResourceType GetResourceType(
+ content::ResourceType resource_type,
+ const std::string& mime_type);
+
// Determines the ResourceType from the mime type, defaulting to the
// |fallback| if the ResourceType could not be determined.
static content::ResourceType GetResourceTypeFromMimeType(
« no previous file with comments | « no previous file | chrome/browser/predictors/resource_prefetch_predictor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698