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

Unified Diff: net/socket/tcp_client_socket.cc

Issue 1096203006: Collect all ConnectionAttempts from both sockets in TransportConnectJob. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@domrel_serverip1
Patch Set: Return fake ConnectionAttempt in MockTCPClientSocket 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/socket/tcp_client_socket.h ('k') | net/socket/transport_client_socket_pool.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « net/socket/tcp_client_socket.h ('k') | net/socket/transport_client_socket_pool.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698