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

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: Don't break build on iOS 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 | « net/http/failing_http_transaction_factory.cc ('k') | net/http/http_network_layer_unittest.cc » ('j') | no next file with comments »
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..e39a6c1c63f4f7075168020d74a0dc619dba0a1a 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 {
@@ -1092,21 +1089,23 @@ int HttpCache::Transaction::DoSendRequestComplete(int result) {
return OK;
}
+ const HttpResponseInfo* response = network_trans_->GetResponseInfo();
+ response_.network_accessed = response->network_accessed;
+
// 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 | « net/http/failing_http_transaction_factory.cc ('k') | net/http/http_network_layer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698