| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 | 8 |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
| (...skipping 834 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 845 if (result == OK) { | 845 if (result == OK) { |
| 846 const HttpResponseInfo* new_response = network_trans_->GetResponseInfo(); | 846 const HttpResponseInfo* new_response = network_trans_->GetResponseInfo(); |
| 847 if (new_response->headers->response_code() == 401 || | 847 if (new_response->headers->response_code() == 401 || |
| 848 new_response->headers->response_code() == 407) { | 848 new_response->headers->response_code() == 407) { |
| 849 auth_response_ = *new_response; | 849 auth_response_ = *new_response; |
| 850 } else { | 850 } else { |
| 851 // Are we expecting a response to a conditional query? | 851 // Are we expecting a response to a conditional query? |
| 852 if (mode_ == READ_WRITE) { | 852 if (mode_ == READ_WRITE) { |
| 853 if (new_response->headers->response_code() == 304) { | 853 if (new_response->headers->response_code() == 304) { |
| 854 // Update cached response based on headers in new_response | 854 // Update cached response based on headers in new_response |
| 855 // TODO(wtc): should we update cached certificate |
| 856 // (response_.ssl_info), too? |
| 855 response_.headers->Update(*new_response->headers); | 857 response_.headers->Update(*new_response->headers); |
| 856 if (response_.headers->HasHeaderValue("cache-control", "no-store")) { | 858 if (response_.headers->HasHeaderValue("cache-control", "no-store")) { |
| 857 cache_->DoomEntry(cache_key_); | 859 cache_->DoomEntry(cache_key_); |
| 858 } else { | 860 } else { |
| 859 WriteResponseInfoToEntry(); | 861 WriteResponseInfoToEntry(); |
| 860 } | 862 } |
| 861 | 863 |
| 862 if (entry_) { | 864 if (entry_) { |
| 863 cache_->ConvertWriterToReader(entry_); | 865 cache_->ConvertWriterToReader(entry_); |
| 864 // We no longer need the network transaction, so destroy it. | 866 // We no longer need the network transaction, so destroy it. |
| (...skipping 506 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1371 | 1373 |
| 1372 entry->pending_queue.erase(entry->pending_queue.begin()); | 1374 entry->pending_queue.erase(entry->pending_queue.begin()); |
| 1373 | 1375 |
| 1374 AddTransactionToEntry(entry, next); | 1376 AddTransactionToEntry(entry, next); |
| 1375 } | 1377 } |
| 1376 | 1378 |
| 1377 //----------------------------------------------------------------------------- | 1379 //----------------------------------------------------------------------------- |
| 1378 | 1380 |
| 1379 } // namespace net | 1381 } // namespace net |
| 1380 | 1382 |
| OLD | NEW |