Chromium Code Reviews| Index: net/http/http_cache_transaction.cc |
| diff --git a/net/http/http_cache_transaction.cc b/net/http/http_cache_transaction.cc |
| index 90a984613adf8d5e58becb8a643e22a33465c667..505dd8fd6c1e663f609c4b0cce7b3682a8c42300 100644 |
| --- a/net/http/http_cache_transaction.cc |
| +++ b/net/http/http_cache_transaction.cc |
| @@ -573,10 +573,7 @@ const HttpResponseInfo* HttpCache::Transaction::GetResponseInfo() const { |
| // Null headers means we encountered an error or haven't a response yet |
| if (auth_response_.headers.get()) |
| return &auth_response_; |
| - return (response_.headers.get() || response_.ssl_info.cert.get() || |
| - response_.cert_request_info.get()) |
| - ? &response_ |
| - : NULL; |
| + return &response_; |
| } |
| LoadState HttpCache::Transaction::GetLoadState() const { |
| @@ -1082,6 +1079,10 @@ int HttpCache::Transaction::DoSendRequestComplete(int result) { |
| if (!cache_.get()) |
| return ERR_UNEXPECTED; |
| + const HttpResponseInfo* response = network_trans_->GetResponseInfo(); |
| + if (response) |
|
davidben
2015/05/14 22:28:14
This can't ever be NULL, can it? That one testing
Deprecated (see juliatuttle)
2015/05/14 23:52:10
Not anymore, no.
|
| + response_.network_accessed = response->network_accessed; |
| + |
|
davidben
2015/05/14 22:28:14
Let's move this after line 1094. In the non-error
Deprecated (see juliatuttle)
2015/05/14 23:52:10
Done.
|
| // If we tried to conditionalize the request and failed, we know |
| // we won't be reading from the cache after this point. |
| if (couldnt_conditionalize_request_) |
| @@ -1095,18 +1096,17 @@ int HttpCache::Transaction::DoSendRequestComplete(int result) { |
| // Do not record requests that have network errors or restarts. |
| UpdateTransactionPattern(PATTERN_NOT_COVERED); |
| if (IsCertificateError(result)) { |
| - const HttpResponseInfo* response = network_trans_->GetResponseInfo(); |
| // If we get a certificate error, then there is a certificate in ssl_info, |
| // so GetResponseInfo() should never return NULL here. |
| DCHECK(response); |
| response_.ssl_info = response->ssl_info; |
| } else if (result == ERR_SSL_CLIENT_AUTH_CERT_NEEDED) { |
| - const HttpResponseInfo* response = network_trans_->GetResponseInfo(); |
| DCHECK(response); |
| response_.cert_request_info = response->cert_request_info; |
| } else if (response_.was_cached) { |
| DoneWritingToEntry(true); |
| } |
| + |
| return result; |
| } |