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

Unified Diff: net/http/http_cache_transaction.cc

Issue 2398613002: [HttpCache] LOAD_ONLY_FROM_CACHE should not imply LOAD_PREFERRING_CACHE (Closed)
Patch Set: Always check vary Created 4 years, 2 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 | « net/http/http_cache.cc ('k') | net/http/http_cache_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_cache_transaction.cc
diff --git a/net/http/http_cache_transaction.cc b/net/http/http_cache_transaction.cc
index 370862d49f90e73a6561ce1931f7d32c51d65b5f..581ac868decccdff33227e1de3e1cfd9722fc915 100644
--- a/net/http/http_cache_transaction.cc
+++ b/net/http/http_cache_transaction.cc
@@ -1984,13 +1984,16 @@ int HttpCache::Transaction::BeginCacheRead() {
return ERR_CACHE_MISS;
}
- if (request_->method == "HEAD")
- FixHeadersForHead();
-
// We don't have the whole resource.
if (truncated_)
return ERR_CACHE_MISS;
+ if (RequiresValidation() != VALIDATION_NONE)
+ return ERR_CACHE_MISS;
+
+ if (request_->method == "HEAD")
+ FixHeadersForHead();
+
if (entry_->disk_entry->GetDataSize(kMetadataIndex))
next_state_ = STATE_CACHE_READ_METADATA;
@@ -2204,7 +2207,7 @@ ValidationType HttpCache::Transaction::RequiresValidation() {
return VALIDATION_SYNCHRONOUS;
}
- if (effective_load_flags_ & LOAD_PREFERRING_CACHE)
+ if (effective_load_flags_ & LOAD_SKIP_CACHE_VALIDATION)
return VALIDATION_NONE;
if (response_.unused_since_prefetch &&
« no previous file with comments | « net/http/http_cache.cc ('k') | net/http/http_cache_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698