| 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 1962 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1973 | 1973 |
| 1974 if (request_->method == "DELETE") | 1974 if (request_->method == "DELETE") |
| 1975 return false; | 1975 return false; |
| 1976 | 1976 |
| 1977 return true; | 1977 return true; |
| 1978 } | 1978 } |
| 1979 | 1979 |
| 1980 int HttpCache::Transaction::BeginCacheRead() { | 1980 int HttpCache::Transaction::BeginCacheRead() { |
| 1981 // We don't support any combination of LOAD_ONLY_FROM_CACHE and byte ranges. | 1981 // We don't support any combination of LOAD_ONLY_FROM_CACHE and byte ranges. |
| 1982 if (response_.headers->response_code() == 206 || partial_) { | 1982 if (response_.headers->response_code() == 206 || partial_) { |
| 1983 NOTREACHED(); | |
| 1984 return ERR_CACHE_MISS; | 1983 return ERR_CACHE_MISS; |
| 1985 } | 1984 } |
| 1986 | 1985 |
| 1987 if (request_->method == "HEAD") | 1986 if (request_->method == "HEAD") |
| 1988 FixHeadersForHead(); | 1987 FixHeadersForHead(); |
| 1989 | 1988 |
| 1990 // We don't have the whole resource. | 1989 // We don't have the whole resource. |
| 1991 if (truncated_) | 1990 if (truncated_) |
| 1992 return ERR_CACHE_MISS; | 1991 return ERR_CACHE_MISS; |
| 1993 | 1992 |
| (...skipping 945 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2939 default: | 2938 default: |
| 2940 NOTREACHED(); | 2939 NOTREACHED(); |
| 2941 } | 2940 } |
| 2942 } | 2941 } |
| 2943 | 2942 |
| 2944 void HttpCache::Transaction::OnIOComplete(int result) { | 2943 void HttpCache::Transaction::OnIOComplete(int result) { |
| 2945 DoLoop(result); | 2944 DoLoop(result); |
| 2946 } | 2945 } |
| 2947 | 2946 |
| 2948 } // namespace net | 2947 } // namespace net |
| OLD | NEW |