| OLD | NEW |
| 1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2009 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.h" | 5 #include "net/http/http_cache.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| (...skipping 1426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1437 } | 1437 } |
| 1438 | 1438 |
| 1439 // Are we expecting a response to a conditional query? | 1439 // Are we expecting a response to a conditional query? |
| 1440 if (mode_ == READ_WRITE || mode_ == UPDATE) { | 1440 if (mode_ == READ_WRITE || mode_ == UPDATE) { |
| 1441 if (new_response->headers->response_code() == 304 || partial_content) { | 1441 if (new_response->headers->response_code() == 304 || partial_content) { |
| 1442 // Update cached response based on headers in new_response. | 1442 // Update cached response based on headers in new_response. |
| 1443 // TODO(wtc): should we update cached certificate | 1443 // TODO(wtc): should we update cached certificate |
| 1444 // (response_.ssl_info), too? | 1444 // (response_.ssl_info), too? |
| 1445 response_.headers->Update(*new_response->headers); | 1445 response_.headers->Update(*new_response->headers); |
| 1446 response_.response_time = new_response->response_time; | 1446 response_.response_time = new_response->response_time; |
| 1447 response_.request_time = new_response->request_time; |
| 1447 | 1448 |
| 1448 if (response_.headers->HasHeaderValue("cache-control", "no-store")) { | 1449 if (response_.headers->HasHeaderValue("cache-control", "no-store")) { |
| 1449 cache_->DoomEntry(cache_key_); | 1450 cache_->DoomEntry(cache_key_); |
| 1450 } else { | 1451 } else { |
| 1451 // If we are already reading, we already updated the headers for | 1452 // If we are already reading, we already updated the headers for |
| 1452 // this request; doing it again will change Content-Length. | 1453 // this request; doing it again will change Content-Length. |
| 1453 if (!reading_) | 1454 if (!reading_) |
| 1454 WriteResponseInfoToEntry(); | 1455 WriteResponseInfoToEntry(); |
| 1455 } | 1456 } |
| 1456 | 1457 |
| (...skipping 605 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2062 static_cast<net::HttpNetworkLayer*>(network_layer_.get()); | 2063 static_cast<net::HttpNetworkLayer*>(network_layer_.get()); |
| 2063 HttpNetworkSession* session = network->GetSession(); | 2064 HttpNetworkSession* session = network->GetSession(); |
| 2064 if (session) { | 2065 if (session) { |
| 2065 session->tcp_socket_pool()->CloseIdleSockets(); | 2066 session->tcp_socket_pool()->CloseIdleSockets(); |
| 2066 } | 2067 } |
| 2067 } | 2068 } |
| 2068 | 2069 |
| 2069 //----------------------------------------------------------------------------- | 2070 //----------------------------------------------------------------------------- |
| 2070 | 2071 |
| 2071 } // namespace net | 2072 } // namespace net |
| OLD | NEW |