Index: net/socket/tcp_client_socket.cc |
diff --git a/net/socket/tcp_client_socket.cc b/net/socket/tcp_client_socket.cc |
index 4a72bdf1d0c93a386a0f50d5d447d62758687a43..a1c1fadb85e2b8ba0d01c600c760536f7e206eeb 100644 |
--- a/net/socket/tcp_client_socket.cc |
+++ b/net/socket/tcp_client_socket.cc |
@@ -124,6 +124,7 @@ int TCPClientSocket::DoConnect() { |
if (previously_disconnected_) { |
use_history_.Reset(); |
+ connection_attempts_.clear(); |
previously_disconnected_ = false; |
} |
@@ -159,6 +160,9 @@ int TCPClientSocket::DoConnectComplete(int result) { |
return OK; // Done! |
} |
+ connection_attempts_.push_back( |
+ ConnectionAttempt(addresses_[current_address_index_], result)); |
+ |
// Close whatever partially connected socket we currently have. |
DoDisconnect(); |
@@ -296,6 +300,20 @@ bool TCPClientSocket::SetNoDelay(bool no_delay) { |
return socket_->SetNoDelay(no_delay); |
} |
+void TCPClientSocket::GetConnectionAttempts(ConnectionAttempts* out) const { |
+ *out = connection_attempts_; |
+} |
+ |
+void TCPClientSocket::ClearConnectionAttempts() { |
+ connection_attempts_.clear(); |
+} |
+ |
+void TCPClientSocket::AddConnectionAttempts( |
+ const ConnectionAttempts& attempts) { |
+ connection_attempts_.insert(connection_attempts_.begin(), attempts.begin(), |
+ attempts.end()); |
+} |
+ |
void TCPClientSocket::DidCompleteConnect(int result) { |
DCHECK_EQ(next_connect_state_, CONNECT_STATE_CONNECT_COMPLETE); |
DCHECK_NE(result, ERR_IO_PENDING); |