diff options
author | ttuttle <ttuttle@chromium.org> | 2015-05-14 18:28:03 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-05-15 01:28:20 +0000 |
commit | 23fdb7b4ed86ee9f63b16a3b432fa2c721432bd2 (patch) | |
tree | c588b5338738541f02cfab69a8b213670127c744 /jingle/glue | |
parent | c0c828496a25acd34b85985b412799933a36f1ff (diff) | |
download | chromium_src-23fdb7b4ed86ee9f63b16a3b432fa2c721432bd2.zip chromium_src-23fdb7b4ed86ee9f63b16a3b432fa2c721432bd2.tar.gz chromium_src-23fdb7b4ed86ee9f63b16a3b432fa2c721432bd2.tar.bz2 |
Collect all ConnectionAttempts from both sockets in TransportConnectJob.
Before, the TransportConnectJob simply inferred that, if the main socket
failed to connect, the address it was using was the last address in the
list. With this change, the TCPClientSocket actually tracks all of the
connection attempts made (as it tries each address in the list), and the
TransportConnectJob copies the attempts from both the main and fallback
sockets and records all of them in the ClientSocketHandle in
GetAdditionalErrorState.
BUG=480565
TBR=jam
Review URL: https://codereview.chromium.org/1096203006
Cr-Commit-Position: refs/heads/master@{#330012}
Diffstat (limited to 'jingle/glue')
-rw-r--r-- | jingle/glue/fake_ssl_client_socket.cc | 5 | ||||
-rw-r--r-- | jingle/glue/fake_ssl_client_socket.h | 4 | ||||
-rw-r--r-- | jingle/glue/fake_ssl_client_socket_unittest.cc | 3 | ||||
-rw-r--r-- | jingle/glue/proxy_resolving_client_socket.cc | 5 | ||||
-rw-r--r-- | jingle/glue/proxy_resolving_client_socket.h | 4 | ||||
-rw-r--r-- | jingle/glue/pseudotcp_adapter.cc | 6 | ||||
-rw-r--r-- | jingle/glue/pseudotcp_adapter.h | 4 |
7 files changed, 31 insertions, 0 deletions
diff --git a/jingle/glue/fake_ssl_client_socket.cc b/jingle/glue/fake_ssl_client_socket.cc index 4cc6867..657bd76 100644 --- a/jingle/glue/fake_ssl_client_socket.cc +++ b/jingle/glue/fake_ssl_client_socket.cc @@ -344,4 +344,9 @@ bool FakeSSLClientSocket::GetSSLInfo(net::SSLInfo* ssl_info) { return transport_socket_->GetSSLInfo(ssl_info); } +void FakeSSLClientSocket::GetConnectionAttempts( + net::ConnectionAttempts* out) const { + out->clear(); +} + } // namespace jingle_glue diff --git a/jingle/glue/fake_ssl_client_socket.h b/jingle/glue/fake_ssl_client_socket.h index bf951d6..8f90429 100644 --- a/jingle/glue/fake_ssl_client_socket.h +++ b/jingle/glue/fake_ssl_client_socket.h @@ -67,6 +67,10 @@ class FakeSSLClientSocket : public net::StreamSocket { bool WasNpnNegotiated() const override; net::NextProto GetNegotiatedProtocol() const override; bool GetSSLInfo(net::SSLInfo* ssl_info) override; + void GetConnectionAttempts(net::ConnectionAttempts* out) const override; + void ClearConnectionAttempts() override {} + void AddConnectionAttempts(const net::ConnectionAttempts& attempts) override { + } private: enum HandshakeState { diff --git a/jingle/glue/fake_ssl_client_socket_unittest.cc b/jingle/glue/fake_ssl_client_socket_unittest.cc index 4df4a7d..0f81127 100644 --- a/jingle/glue/fake_ssl_client_socket_unittest.cc +++ b/jingle/glue/fake_ssl_client_socket_unittest.cc @@ -68,6 +68,9 @@ class MockClientSocket : public net::StreamSocket { MOCK_CONST_METHOD0(WasNpnNegotiated, bool()); MOCK_CONST_METHOD0(GetNegotiatedProtocol, net::NextProto()); MOCK_METHOD1(GetSSLInfo, bool(net::SSLInfo*)); + MOCK_CONST_METHOD1(GetConnectionAttempts, void(net::ConnectionAttempts*)); + MOCK_METHOD0(ClearConnectionAttempts, void()); + MOCK_METHOD1(AddConnectionAttempts, void(const net::ConnectionAttempts&)); }; // Break up |data| into a bunch of chunked MockReads/Writes and push diff --git a/jingle/glue/proxy_resolving_client_socket.cc b/jingle/glue/proxy_resolving_client_socket.cc index 5a6e068..9eb2da3 100644 --- a/jingle/glue/proxy_resolving_client_socket.cc +++ b/jingle/glue/proxy_resolving_client_socket.cc @@ -420,6 +420,11 @@ bool ProxyResolvingClientSocket::GetSSLInfo(net::SSLInfo* ssl_info) { return false; } +void ProxyResolvingClientSocket::GetConnectionAttempts( + net::ConnectionAttempts* out) const { + out->clear(); +} + void ProxyResolvingClientSocket::CloseTransportSocket() { if (transport_.get() && transport_->socket()) transport_->socket()->Disconnect(); diff --git a/jingle/glue/proxy_resolving_client_socket.h b/jingle/glue/proxy_resolving_client_socket.h index 696a097..e8f22ce 100644 --- a/jingle/glue/proxy_resolving_client_socket.h +++ b/jingle/glue/proxy_resolving_client_socket.h @@ -70,6 +70,10 @@ class ProxyResolvingClientSocket : public net::StreamSocket { bool WasNpnNegotiated() const override; net::NextProto GetNegotiatedProtocol() const override; bool GetSSLInfo(net::SSLInfo* ssl_info) override; + void GetConnectionAttempts(net::ConnectionAttempts* out) const override; + void ClearConnectionAttempts() override {} + void AddConnectionAttempts(const net::ConnectionAttempts& attempts) override { + } private: // Proxy resolution and connection functions. diff --git a/jingle/glue/pseudotcp_adapter.cc b/jingle/glue/pseudotcp_adapter.cc index 5a26f7d..db27502 100644 --- a/jingle/glue/pseudotcp_adapter.cc +++ b/jingle/glue/pseudotcp_adapter.cc @@ -582,6 +582,12 @@ bool PseudoTcpAdapter::GetSSLInfo(net::SSLInfo* ssl_info) { return false; } +void PseudoTcpAdapter::GetConnectionAttempts( + net::ConnectionAttempts* out) const { + DCHECK(CalledOnValidThread()); + out->clear(); +} + void PseudoTcpAdapter::SetAckDelay(int delay_ms) { DCHECK(CalledOnValidThread()); core_->SetAckDelay(delay_ms); diff --git a/jingle/glue/pseudotcp_adapter.h b/jingle/glue/pseudotcp_adapter.h index 1473000..8b11e2e 100644 --- a/jingle/glue/pseudotcp_adapter.h +++ b/jingle/glue/pseudotcp_adapter.h @@ -53,6 +53,10 @@ class PseudoTcpAdapter : public net::StreamSocket, base::NonThreadSafe { bool WasNpnNegotiated() const override; net::NextProto GetNegotiatedProtocol() const override; bool GetSSLInfo(net::SSLInfo* ssl_info) override; + void GetConnectionAttempts(net::ConnectionAttempts* out) const override; + void ClearConnectionAttempts() override {} + void AddConnectionAttempts(const net::ConnectionAttempts& attempts) override { + } // Set the delay for sending ACK. void SetAckDelay(int delay_ms); |