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

Unified Diff: net/http/http_network_transaction.cc

Issue 1006643002: Plumb connection attempts from (non-proxy) ConnectJobs to HttpNetworkTransaction. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Don't copy attempts after reset on proxy HTTPS tunnel response Created 5 years, 9 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
Index: net/http/http_network_transaction.cc
diff --git a/net/http/http_network_transaction.cc b/net/http/http_network_transaction.cc
index 199a5ff4d18e9a6a2fd17a562c2d49373f9f7126..d87ad6dd39f4e20a59a987be0e65b732b61d513d 100644
--- a/net/http/http_network_transaction.cc
+++ b/net/http/http_network_transaction.cc
@@ -562,6 +562,8 @@ void HttpNetworkTransaction::OnHttpsProxyTunnelResponse(
HttpStream* stream) {
DCHECK_EQ(STATE_CREATE_STREAM_COMPLETE, next_state_);
+ CopyConnectionAttempts();
+
headers_valid_ = true;
response_ = response_info;
server_ssl_config_ = used_ssl_config;
@@ -573,6 +575,11 @@ void HttpNetworkTransaction::OnHttpsProxyTunnelResponse(
OnIOComplete(ERR_HTTPS_PROXY_TUNNEL_RESPONSE);
}
+const ClientSocketHandle::ConnectionAttempts&
+HttpNetworkTransaction::connection_attempts() const {
+ return connection_attempts_;
+}
+
bool HttpNetworkTransaction::IsSecureRequest() const {
return request_->url.SchemeIsSecure();
}
@@ -753,6 +760,9 @@ int HttpNetworkTransaction::DoCreateStream() {
}
int HttpNetworkTransaction::DoCreateStreamComplete(int result) {
+ if (result != ERR_HTTPS_PROXY_TUNNEL_RESPONSE)
+ CopyConnectionAttempts();
+
if (result == OK) {
next_state_ = STATE_INIT_STREAM;
DCHECK(stream_.get());
@@ -1544,4 +1554,11 @@ std::string HttpNetworkTransaction::DescribeState(State state) {
#undef STATE_CASE
+void HttpNetworkTransaction::CopyConnectionAttempts() {
+ DCHECK(stream_request_);
+
+ for (const auto& attempt : stream_request_->connection_attempts())
+ connection_attempts_.push_back(attempt);
+}
+
} // namespace net

Powered by Google App Engine
This is Rietveld 408576698