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" | 7 #include "build/build_config.h" |
8 | 8 |
9 #if defined(OS_POSIX) | 9 #if defined(OS_POSIX) |
10 #include <unistd.h> | 10 #include <unistd.h> |
(...skipping 1626 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1637 const ValidationHeaderInfo& info = kValidationHeaders[i]; | 1637 const ValidationHeaderInfo& info = kValidationHeaders[i]; |
1638 std::string validation_value; | 1638 std::string validation_value; |
1639 if (request_->extra_headers.GetHeader( | 1639 if (request_->extra_headers.GetHeader( |
1640 info.request_header_name, &validation_value)) { | 1640 info.request_header_name, &validation_value)) { |
1641 if (!external_validation_.values[i].empty() || | 1641 if (!external_validation_.values[i].empty() || |
1642 validation_value.empty()) { | 1642 validation_value.empty()) { |
1643 external_validation_error = true; | 1643 external_validation_error = true; |
1644 } | 1644 } |
1645 external_validation_.values[i] = validation_value; | 1645 external_validation_.values[i] = validation_value; |
1646 external_validation_.initialized = true; | 1646 external_validation_.initialized = true; |
1647 break; | |
1648 } | 1647 } |
1649 } | 1648 } |
1650 | 1649 |
1651 // We don't support ranges and validation headers. | 1650 // We don't support ranges and validation headers. |
1652 if (range_found && external_validation_.initialized) { | 1651 if (range_found && external_validation_.initialized) { |
1653 LOG(WARNING) << "Byte ranges AND validation headers found."; | 1652 LOG(WARNING) << "Byte ranges AND validation headers found."; |
1654 effective_load_flags_ |= LOAD_DISABLE_CACHE; | 1653 effective_load_flags_ |= LOAD_DISABLE_CACHE; |
1655 } | 1654 } |
1656 | 1655 |
1657 // If there is more than one validation header, we can't treat this request as | 1656 // If there is more than one validation header, we can't treat this request as |
(...skipping 850 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2508 } | 2507 } |
2509 | 2508 |
2510 int HttpCache::Transaction::ResetCacheIOStart(int return_value) { | 2509 int HttpCache::Transaction::ResetCacheIOStart(int return_value) { |
2511 DCHECK(cache_io_start_.is_null()); | 2510 DCHECK(cache_io_start_.is_null()); |
2512 if (return_value == ERR_IO_PENDING) | 2511 if (return_value == ERR_IO_PENDING) |
2513 cache_io_start_ = base::TimeTicks::Now(); | 2512 cache_io_start_ = base::TimeTicks::Now(); |
2514 return return_value; | 2513 return return_value; |
2515 } | 2514 } |
2516 | 2515 |
2517 } // namespace net | 2516 } // namespace net |
OLD | NEW |