diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2017-03-08 10:28:10 +0100 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2017-03-20 13:40:30 +0000 |
commit | e733310db58160074f574c429d48f8308c0afe17 (patch) | |
tree | f8aef4b7e62a69928dbcf880620eece20f98c6df /chromium/net/http/http_cache_transaction.cc | |
parent | 2f583e4aec1ae3a86fa047829c96b310dc12ecdf (diff) | |
download | qtwebengine-chromium-e733310db58160074f574c429d48f8308c0afe17.tar.gz |
BASELINE: Update Chromium to 56.0.2924.122
Change-Id: I4e04de8f47e47e501c46ed934c76a431c6337ced
Reviewed-by: Michael BrĂ¼ning <michael.bruning@qt.io>
Diffstat (limited to 'chromium/net/http/http_cache_transaction.cc')
-rw-r--r-- | chromium/net/http/http_cache_transaction.cc | 26 |
1 files changed, 14 insertions, 12 deletions
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 && |