| OLD | NEW |
| 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 2183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2194 if (rv != ERR_IO_PENDING) | 2194 if (rv != ERR_IO_PENDING) |
| 2195 return DoLoop(rv); | 2195 return DoLoop(rv); |
| 2196 return rv; | 2196 return rv; |
| 2197 } | 2197 } |
| 2198 | 2198 |
| 2199 ValidationType HttpCache::Transaction::RequiresValidation() { | 2199 ValidationType HttpCache::Transaction::RequiresValidation() { |
| 2200 // TODO(darin): need to do more work here: | 2200 // TODO(darin): need to do more work here: |
| 2201 // - make sure we have a matching request method | 2201 // - make sure we have a matching request method |
| 2202 // - watch out for cached responses that depend on authentication | 2202 // - watch out for cached responses that depend on authentication |
| 2203 | 2203 |
| 2204 if (response_.vary_data.is_valid() && | 2204 if (!(effective_load_flags_ & LOAD_SKIP_VARY_CHECK) && |
| 2205 response_.vary_data.is_valid() && |
| 2205 !response_.vary_data.MatchesRequest(*request_, | 2206 !response_.vary_data.MatchesRequest(*request_, |
| 2206 *response_.headers.get())) { | 2207 *response_.headers.get())) { |
| 2207 vary_mismatch_ = true; | 2208 vary_mismatch_ = true; |
| 2208 validation_cause_ = VALIDATION_CAUSE_VARY_MISMATCH; | 2209 validation_cause_ = VALIDATION_CAUSE_VARY_MISMATCH; |
| 2209 return VALIDATION_SYNCHRONOUS; | 2210 return VALIDATION_SYNCHRONOUS; |
| 2210 } | 2211 } |
| 2211 | 2212 |
| 2212 if (effective_load_flags_ & LOAD_SKIP_CACHE_VALIDATION) | 2213 if (effective_load_flags_ & LOAD_SKIP_CACHE_VALIDATION) |
| 2213 return VALIDATION_NONE; | 2214 return VALIDATION_NONE; |
| 2214 | 2215 |
| (...skipping 729 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2944 default: | 2945 default: |
| 2945 NOTREACHED(); | 2946 NOTREACHED(); |
| 2946 } | 2947 } |
| 2947 } | 2948 } |
| 2948 | 2949 |
| 2949 void HttpCache::Transaction::OnIOComplete(int result) { | 2950 void HttpCache::Transaction::OnIOComplete(int result) { |
| 2950 DoLoop(result); | 2951 DoLoop(result); |
| 2951 } | 2952 } |
| 2952 | 2953 |
| 2953 } // namespace net | 2954 } // namespace net |
| OLD | NEW |