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

Side by Side Diff: net/http/http_cache_transaction.cc

Issue 2539323003: [HttpCacheTransaction] Ignore vary check for WriteMetadata requests (Closed)
Patch Set: Nits 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/http/http_cache_transaction.h" 5 #include "net/http/http_cache_transaction.h"
6 6
7 #include "build/build_config.h" // For OS_POSIX 7 #include "build/build_config.h" // For OS_POSIX
8 8
9 #if defined(OS_POSIX) 9 #if defined(OS_POSIX)
10 #include <unistd.h> 10 #include <unistd.h>
(...skipping 2228 matching lines...) Expand 10 before | Expand all | Expand 10 after
2239 if (rv != ERR_IO_PENDING) 2239 if (rv != ERR_IO_PENDING)
2240 return DoLoop(rv); 2240 return DoLoop(rv);
2241 return rv; 2241 return rv;
2242 } 2242 }
2243 2243
2244 ValidationType HttpCache::Transaction::RequiresValidation() { 2244 ValidationType HttpCache::Transaction::RequiresValidation() {
2245 // TODO(darin): need to do more work here: 2245 // TODO(darin): need to do more work here:
2246 // - make sure we have a matching request method 2246 // - make sure we have a matching request method
2247 // - watch out for cached responses that depend on authentication 2247 // - watch out for cached responses that depend on authentication
2248 2248
2249 if (response_.vary_data.is_valid() && 2249 if (!(effective_load_flags_ & LOAD_SKIP_VARY_CHECK) &&
2250 response_.vary_data.is_valid() &&
2250 !response_.vary_data.MatchesRequest(*request_, 2251 !response_.vary_data.MatchesRequest(*request_,
2251 *response_.headers.get())) { 2252 *response_.headers.get())) {
2252 vary_mismatch_ = true; 2253 vary_mismatch_ = true;
2253 validation_cause_ = VALIDATION_CAUSE_VARY_MISMATCH; 2254 validation_cause_ = VALIDATION_CAUSE_VARY_MISMATCH;
2254 return VALIDATION_SYNCHRONOUS; 2255 return VALIDATION_SYNCHRONOUS;
2255 } 2256 }
2256 2257
2257 if (effective_load_flags_ & LOAD_SKIP_CACHE_VALIDATION) 2258 if (effective_load_flags_ & LOAD_SKIP_CACHE_VALIDATION)
2258 return VALIDATION_NONE; 2259 return VALIDATION_NONE;
2259 2260
(...skipping 729 matching lines...) Expand 10 before | Expand all | Expand 10 after
2989 default: 2990 default:
2990 NOTREACHED(); 2991 NOTREACHED();
2991 } 2992 }
2992 } 2993 }
2993 2994
2994 void HttpCache::Transaction::OnIOComplete(int result) { 2995 void HttpCache::Transaction::OnIOComplete(int result) {
2995 DoLoop(result); 2996 DoLoop(result);
2996 } 2997 }
2997 2998
2998 } // namespace net 2999 } // namespace net
OLDNEW
« 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