Chromium Code Reviews| 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 | 10 |
| (...skipping 920 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 931 // Truncate response data | 931 // Truncate response data |
| 932 TruncateResponseData(); | 932 TruncateResponseData(); |
| 933 | 933 |
| 934 // If this response is a redirect, then we can stop writing now. (We | 934 // If this response is a redirect, then we can stop writing now. (We |
| 935 // don't need to cache the response body of a redirect.) | 935 // don't need to cache the response body of a redirect.) |
| 936 if (response_.headers->IsRedirect(NULL)) | 936 if (response_.headers->IsRedirect(NULL)) |
| 937 DoneWritingToEntry(true); | 937 DoneWritingToEntry(true); |
| 938 } | 938 } |
| 939 } | 939 } |
| 940 } else if (IsCertificateError(result)) { | 940 } else if (IsCertificateError(result)) { |
| 941 response_.ssl_info = network_trans_->GetResponseInfo()->ssl_info; | 941 const HttpResponseInfo* response = network_trans_->GetResponseInfo(); |
| 942 // If we get a certificate error, then there is a certificate in ssl_info, | |
| 943 // so GetResponseInfo() should never returns NULL here. | |
| 944 DCHECK(response); | |
|
ukai
2009/05/15 03:25:24
Changed DCHECK here.
| |
| 945 response_.ssl_info = response->ssl_info; | |
| 942 } | 946 } |
| 943 HandleResult(result); | 947 HandleResult(result); |
| 944 } | 948 } |
| 945 | 949 |
| 946 void HttpCache::Transaction::OnNetworkReadCompleted(int result) { | 950 void HttpCache::Transaction::OnNetworkReadCompleted(int result) { |
| 947 DCHECK(mode_ & WRITE || mode_ == NONE); | 951 DCHECK(mode_ & WRITE || mode_ == NONE); |
| 948 | 952 |
| 949 if (revoked()) { | 953 if (revoked()) { |
| 950 HandleResult(ERR_UNEXPECTED); | 954 HandleResult(ERR_UNEXPECTED); |
| 951 return; | 955 return; |
| (...skipping 532 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1484 return; // have to wait | 1488 return; // have to wait |
| 1485 | 1489 |
| 1486 entry->pending_queue.erase(entry->pending_queue.begin()); | 1490 entry->pending_queue.erase(entry->pending_queue.begin()); |
| 1487 | 1491 |
| 1488 AddTransactionToEntry(entry, next); | 1492 AddTransactionToEntry(entry, next); |
| 1489 } | 1493 } |
| 1490 | 1494 |
| 1491 //----------------------------------------------------------------------------- | 1495 //----------------------------------------------------------------------------- |
| 1492 | 1496 |
| 1493 } // namespace net | 1497 } // namespace net |
| OLD | NEW |