Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(231)

Unified Diff: net/http/http_cache_transaction.cc

Issue 1072423005: Set network_accessed earlier, when network transaction creates stream. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | net/http/http_network_layer_unittest.cc » ('j') | net/http/http_network_transaction.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
}
« no previous file with comments | « no previous file | net/http/http_network_layer_unittest.cc » ('j') | net/http/http_network_transaction.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698