From e733310db58160074f574c429d48f8308c0afe17 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Wed, 8 Mar 2017 10:28:10 +0100 Subject: BASELINE: Update Chromium to 56.0.2924.122 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I4e04de8f47e47e501c46ed934c76a431c6337ced Reviewed-by: Michael BrĂ¼ning --- chromium/net/http/http_cache_transaction.cc | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) (limited to 'chromium/net/http/http_cache_transaction.cc') diff --git a/chromium/net/http/http_cache_transaction.cc b/chromium/net/http/http_cache_transaction.cc index 45f3db6aed3..717522eb695 100644 --- a/chromium/net/http/http_cache_transaction.cc +++ b/chromium/net/http/http_cache_transaction.cc @@ -1222,13 +1222,11 @@ int HttpCache::Transaction::DoCacheReadResponseComplete(int result) { return OK; } - if ((response_.unused_since_prefetch && - !(request_->load_flags & LOAD_PREFETCH)) || - (!response_.unused_since_prefetch && - (request_->load_flags & LOAD_PREFETCH))) { - // Either this is the first use of an entry since it was prefetched or - // this is a prefetch. The value of response.unused_since_prefetch is valid - // for this transaction but the bit needs to be flipped in storage. + if (response_.unused_since_prefetch != + !!(request_->load_flags & LOAD_PREFETCH)) { + // Either this is the first use of an entry since it was prefetched XOR + // this is a prefetch. The value of response.unused_since_prefetch is + // valid for this transaction but the bit needs to be flipped in storage. next_state_ = STATE_TOGGLE_UNUSED_SINCE_PREFETCH; return OK; } @@ -1988,13 +1986,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; @@ -2200,7 +2201,8 @@ ValidationType HttpCache::Transaction::RequiresValidation() { // - make sure we have a matching request method // - watch out for cached responses that depend on authentication - if (response_.vary_data.is_valid() && + if (!(effective_load_flags_ & LOAD_SKIP_VARY_CHECK) && + response_.vary_data.is_valid() && !response_.vary_data.MatchesRequest(*request_, *response_.headers.get())) { vary_mismatch_ = true; @@ -2208,7 +2210,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 && -- cgit v1.2.1