diff options
author | zhaoqin@chromium.org <zhaoqin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-06-08 00:11:42 +0000 |
---|---|---|
committer | zhaoqin@chromium.org <zhaoqin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-06-08 00:11:42 +0000 |
commit | a352869a59d48c3bd3a4a453d73c3392255275ef (patch) | |
tree | 1375d4e5900d6df89efd8780d82c5874245bef2a | |
parent | dc67e1c39fc3d2373391db49465cc1011c23011d (diff) | |
download | chromium_src-a352869a59d48c3bd3a4a453d73c3392255275ef.zip chromium_src-a352869a59d48c3bd3a4a453d73c3392255275ef.tar.gz chromium_src-a352869a59d48c3bd3a4a453d73c3392255275ef.tar.bz2 |
fixed issue 128383 - replace GetPeerAddress(AddressList* address) with GetPeerAddress(IPEndPoint* address)
R=szym@chromium.org
BUG=128383
TEST=try bot
Review URL: https://chromiumcodereview.appspot.com/10491007
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@141125 0039d316-1c4b-4281-b951-d872f2087c98
58 files changed, 107 insertions, 114 deletions
diff --git a/content/browser/renderer_host/p2p/socket_host_tcp_server.cc b/content/browser/renderer_host/p2p/socket_host_tcp_server.cc index e5d3401..ed92b4d 100644 --- a/content/browser/renderer_host/p2p/socket_host_tcp_server.cc +++ b/content/browser/renderer_host/p2p/socket_host_tcp_server.cc @@ -94,13 +94,12 @@ void P2PSocketHostTcpServer::HandleAcceptResult(int result) { return; } - net::AddressList addr_list; - if (accept_socket_->GetPeerAddress(&addr_list) != net::OK) { + net::IPEndPoint address; + if (accept_socket_->GetPeerAddress(&address) != net::OK) { LOG(ERROR) << "Failed to get address of an accepted socket."; accept_socket_.reset(); return; } - const net::IPEndPoint& address = addr_list.front(); AcceptedSocketsMap::iterator it = accepted_sockets_.find(address); if (it != accepted_sockets_.end()) delete it->second; diff --git a/content/browser/renderer_host/p2p/socket_host_test_utils.h b/content/browser/renderer_host/p2p/socket_host_test_utils.h index 03822ff..9c50cfd 100644 --- a/content/browser/renderer_host/p2p/socket_host_test_utils.h +++ b/content/browser/renderer_host/p2p/socket_host_test_utils.h @@ -66,7 +66,7 @@ class FakeSocket : public net::StreamSocket { virtual void Disconnect() OVERRIDE; virtual bool IsConnected() const OVERRIDE; virtual bool IsConnectedAndIdle() const OVERRIDE; - virtual int GetPeerAddress(net::AddressList* address) const OVERRIDE; + virtual int GetPeerAddress(net::IPEndPoint* address) const OVERRIDE; virtual int GetLocalAddress(net::IPEndPoint* address) const OVERRIDE; virtual const net::BoundNetLog& NetLog() const OVERRIDE; virtual void SetSubresourceSpeculation() OVERRIDE; @@ -180,9 +180,8 @@ bool FakeSocket::IsConnectedAndIdle() const { return false; } -int FakeSocket::GetPeerAddress(net::AddressList* address) const { - *address = net::AddressList::CreateFromIPAddress(peer_address_.address(), - peer_address_.port()); +int FakeSocket::GetPeerAddress(net::IPEndPoint* address) const { + *address = peer_address_; return net::OK; } diff --git a/content/browser/renderer_host/pepper_tcp_server_socket.cc b/content/browser/renderer_host/pepper_tcp_server_socket.cc index 15a39c4..cf21497 100644 --- a/content/browser/renderer_host/pepper_tcp_server_socket.cc +++ b/content/browser/renderer_host/pepper_tcp_server_socket.cc @@ -126,19 +126,19 @@ void PepperTCPServerSocket::OnAcceptCompleted( } else { scoped_ptr<net::StreamSocket> socket(socket_buffer_.release()); - net::IPEndPoint ip_end_point; - net::AddressList address_list; + net::IPEndPoint ip_end_point_local; + net::IPEndPoint ip_end_point_remote; PP_NetAddress_Private local_addr = NetAddressPrivateImpl::kInvalidNetAddress; PP_NetAddress_Private remote_addr = NetAddressPrivateImpl::kInvalidNetAddress; - if (socket->GetLocalAddress(&ip_end_point) != net::OK || - !NetAddressPrivateImpl::IPEndPointToNetAddress(ip_end_point, + if (socket->GetLocalAddress(&ip_end_point_local) != net::OK || + !NetAddressPrivateImpl::IPEndPointToNetAddress(ip_end_point_local, &local_addr) || - socket->GetPeerAddress(&address_list) != net::OK || - !NetAddressPrivateImpl::AddressListToNetAddress(address_list, - &remote_addr)) { + socket->GetPeerAddress(&ip_end_point_remote) != net::OK || + !NetAddressPrivateImpl::IPEndPointToNetAddress(ip_end_point_remote, + &remote_addr)) { SendAcceptACKError(); } else { uint32 accepted_socket_id = diff --git a/content/browser/renderer_host/pepper_tcp_socket.cc b/content/browser/renderer_host/pepper_tcp_socket.cc index d6007f5..232dbc0 100644 --- a/content/browser/renderer_host/pepper_tcp_socket.cc +++ b/content/browser/renderer_host/pepper_tcp_socket.cc @@ -317,19 +317,19 @@ void PepperTCPSocket::OnConnectCompleted(int result) { SendConnectACKError(); connection_state_ = BEFORE_CONNECT; } else { - net::IPEndPoint ip_end_point; - net::AddressList address_list; + net::IPEndPoint ip_end_point_local; + net::IPEndPoint ip_end_point_remote; PP_NetAddress_Private local_addr = NetAddressPrivateImpl::kInvalidNetAddress; PP_NetAddress_Private remote_addr = NetAddressPrivateImpl::kInvalidNetAddress; - if (socket_->GetLocalAddress(&ip_end_point) != net::OK || - !NetAddressPrivateImpl::IPEndPointToNetAddress(ip_end_point, + if (socket_->GetLocalAddress(&ip_end_point_local) != net::OK || + !NetAddressPrivateImpl::IPEndPointToNetAddress(ip_end_point_local, &local_addr) || - socket_->GetPeerAddress(&address_list) != net::OK || - !NetAddressPrivateImpl::AddressListToNetAddress(address_list, - &remote_addr)) { + socket_->GetPeerAddress(&ip_end_point_remote) != net::OK || + !NetAddressPrivateImpl::IPEndPointToNetAddress(ip_end_point_remote, + &remote_addr)) { SendConnectACKError(); connection_state_ = BEFORE_CONNECT; } else { diff --git a/jingle/glue/pseudotcp_adapter.cc b/jingle/glue/pseudotcp_adapter.cc index 40e99e3..65fd156 100644 --- a/jingle/glue/pseudotcp_adapter.cc +++ b/jingle/glue/pseudotcp_adapter.cc @@ -521,13 +521,13 @@ bool PseudoTcpAdapter::IsConnectedAndIdle() const { return false; } -int PseudoTcpAdapter::GetPeerAddress(net::AddressList* address) const { +int PseudoTcpAdapter::GetPeerAddress(net::IPEndPoint* address) const { DCHECK(CalledOnValidThread()); // We don't have a meaningful peer address, but we can't return an // error, so we return a INADDR_ANY instead. - net::IPAddressNumber ip_address(4); - *address = net::AddressList::CreateFromIPAddress(ip_address, 0); + net::IPAddressNumber ip_address(net::kIPv4AddressSize); + *address = net::IPEndPoint(ip_address, 0); return net::OK; } diff --git a/jingle/glue/pseudotcp_adapter.h b/jingle/glue/pseudotcp_adapter.h index eed2504..c0114a8 100644 --- a/jingle/glue/pseudotcp_adapter.h +++ b/jingle/glue/pseudotcp_adapter.h @@ -42,7 +42,7 @@ class PseudoTcpAdapter : public net::StreamSocket, base::NonThreadSafe { virtual void Disconnect() OVERRIDE; virtual bool IsConnected() const OVERRIDE; virtual bool IsConnectedAndIdle() const OVERRIDE; - virtual int GetPeerAddress(net::AddressList* address) const OVERRIDE; + virtual int GetPeerAddress(net::IPEndPoint* address) const OVERRIDE; virtual int GetLocalAddress(net::IPEndPoint* address) const OVERRIDE; virtual const net::BoundNetLog& NetLog() const OVERRIDE; virtual void SetSubresourceSpeculation() OVERRIDE; diff --git a/jingle/notifier/base/fake_ssl_client_socket.cc b/jingle/notifier/base/fake_ssl_client_socket.cc index 7ca6afc..ec8fd26 100644 --- a/jingle/notifier/base/fake_ssl_client_socket.cc +++ b/jingle/notifier/base/fake_ssl_client_socket.cc @@ -302,7 +302,7 @@ bool FakeSSLClientSocket::IsConnectedAndIdle() const { return handshake_completed_ && transport_socket_->IsConnectedAndIdle(); } -int FakeSSLClientSocket::GetPeerAddress(net::AddressList* address) const { +int FakeSSLClientSocket::GetPeerAddress(net::IPEndPoint* address) const { return transport_socket_->GetPeerAddress(address); } diff --git a/jingle/notifier/base/fake_ssl_client_socket.h b/jingle/notifier/base/fake_ssl_client_socket.h index a0ef858..7705a99 100644 --- a/jingle/notifier/base/fake_ssl_client_socket.h +++ b/jingle/notifier/base/fake_ssl_client_socket.h @@ -56,7 +56,7 @@ class FakeSSLClientSocket : public net::StreamSocket { virtual void Disconnect() OVERRIDE; virtual bool IsConnected() const OVERRIDE; virtual bool IsConnectedAndIdle() const OVERRIDE; - virtual int GetPeerAddress(net::AddressList* address) const OVERRIDE; + virtual int GetPeerAddress(net::IPEndPoint* address) const OVERRIDE; virtual int GetLocalAddress(net::IPEndPoint* address) const OVERRIDE; virtual const net::BoundNetLog& NetLog() const OVERRIDE; virtual void SetSubresourceSpeculation() OVERRIDE; diff --git a/jingle/notifier/base/fake_ssl_client_socket_unittest.cc b/jingle/notifier/base/fake_ssl_client_socket_unittest.cc index 96472df..fddb693 100644 --- a/jingle/notifier/base/fake_ssl_client_socket_unittest.cc +++ b/jingle/notifier/base/fake_ssl_client_socket_unittest.cc @@ -56,7 +56,7 @@ class MockClientSocket : public net::StreamSocket { MOCK_METHOD0(Disconnect, void()); MOCK_CONST_METHOD0(IsConnected, bool()); MOCK_CONST_METHOD0(IsConnectedAndIdle, bool()); - MOCK_CONST_METHOD1(GetPeerAddress, int(net::AddressList*)); + MOCK_CONST_METHOD1(GetPeerAddress, int(net::IPEndPoint*)); MOCK_CONST_METHOD1(GetLocalAddress, int(net::IPEndPoint*)); MOCK_CONST_METHOD0(NetLog, const net::BoundNetLog&()); MOCK_METHOD0(SetSubresourceSpeculation, void()); @@ -270,12 +270,12 @@ TEST_F(FakeSSLClientSocketTest, PassThroughMethods) { MockClientSocket* mock_client_socket = new MockClientSocket(); const int kReceiveBufferSize = 10; const int kSendBufferSize = 20; - net::AddressList address_list; + net::IPEndPoint ip_endpoint(net::IPAddressNumber(net::kIPv4AddressSize), 80); const int kPeerAddress = 30; net::BoundNetLog net_log; EXPECT_CALL(*mock_client_socket, SetReceiveBufferSize(kReceiveBufferSize)); EXPECT_CALL(*mock_client_socket, SetSendBufferSize(kSendBufferSize)); - EXPECT_CALL(*mock_client_socket, GetPeerAddress(&address_list)). + EXPECT_CALL(*mock_client_socket, GetPeerAddress(&ip_endpoint)). WillOnce(Return(kPeerAddress)); EXPECT_CALL(*mock_client_socket, NetLog()).WillOnce(ReturnRef(net_log)); EXPECT_CALL(*mock_client_socket, SetSubresourceSpeculation()); @@ -286,7 +286,7 @@ TEST_F(FakeSSLClientSocketTest, PassThroughMethods) { fake_ssl_client_socket.SetReceiveBufferSize(kReceiveBufferSize); fake_ssl_client_socket.SetSendBufferSize(kSendBufferSize); EXPECT_EQ(kPeerAddress, - fake_ssl_client_socket.GetPeerAddress(&address_list)); + fake_ssl_client_socket.GetPeerAddress(&ip_endpoint)); EXPECT_EQ(&net_log, &fake_ssl_client_socket.NetLog()); fake_ssl_client_socket.SetSubresourceSpeculation(); fake_ssl_client_socket.SetOmniboxSpeculation(); diff --git a/jingle/notifier/base/proxy_resolving_client_socket.cc b/jingle/notifier/base/proxy_resolving_client_socket.cc index 3c3d082c..9329c29 100644 --- a/jingle/notifier/base/proxy_resolving_client_socket.cc +++ b/jingle/notifier/base/proxy_resolving_client_socket.cc @@ -305,7 +305,7 @@ bool ProxyResolvingClientSocket::IsConnectedAndIdle() const { } int ProxyResolvingClientSocket::GetPeerAddress( - net::AddressList* address) const { + net::IPEndPoint* address) const { if (transport_.get() && transport_->socket()) return transport_->socket()->GetPeerAddress(address); NOTREACHED(); diff --git a/jingle/notifier/base/proxy_resolving_client_socket.h b/jingle/notifier/base/proxy_resolving_client_socket.h index 88b488a..0a0aebf 100644 --- a/jingle/notifier/base/proxy_resolving_client_socket.h +++ b/jingle/notifier/base/proxy_resolving_client_socket.h @@ -58,7 +58,7 @@ class ProxyResolvingClientSocket : public net::StreamSocket { virtual void Disconnect() OVERRIDE; virtual bool IsConnected() const OVERRIDE; virtual bool IsConnectedAndIdle() const OVERRIDE; - virtual int GetPeerAddress(net::AddressList* address) const OVERRIDE; + virtual int GetPeerAddress(net::IPEndPoint* address) const OVERRIDE; virtual int GetLocalAddress(net::IPEndPoint* address) const OVERRIDE; virtual const net::BoundNetLog& NetLog() const OVERRIDE; virtual void SetSubresourceSpeculation() OVERRIDE; diff --git a/net/curvecp/curvecp_client_socket.cc b/net/curvecp/curvecp_client_socket.cc index 4aaea1b..8da55b68 100644 --- a/net/curvecp/curvecp_client_socket.cc +++ b/net/curvecp/curvecp_client_socket.cc @@ -41,12 +41,12 @@ bool CurveCPClientSocket::IsConnectedAndIdle() const { return false; } -int CurveCPClientSocket::GetPeerAddress(AddressList* address) const { +int CurveCPClientSocket::GetPeerAddress(IPEndPoint* address) const { IPEndPoint endpoint; int rv = packetizer_.GetPeerAddress(&endpoint); if (rv < 0) return rv; - *address = AddressList(endpoint); + *address = endpoint; return OK; } diff --git a/net/curvecp/curvecp_client_socket.h b/net/curvecp/curvecp_client_socket.h index 3c6eea6..2db574f 100644 --- a/net/curvecp/curvecp_client_socket.h +++ b/net/curvecp/curvecp_client_socket.h @@ -30,7 +30,7 @@ class CurveCPClientSocket : public StreamSocket { virtual void Disconnect() OVERRIDE; virtual bool IsConnected() const OVERRIDE; virtual bool IsConnectedAndIdle() const OVERRIDE; - virtual int GetPeerAddress(AddressList* address) const OVERRIDE; + virtual int GetPeerAddress(IPEndPoint* address) const OVERRIDE; virtual int GetLocalAddress(IPEndPoint* address) const OVERRIDE; virtual const BoundNetLog& NetLog() const OVERRIDE; virtual void SetSubresourceSpeculation() OVERRIDE; diff --git a/net/ftp/ftp_network_transaction.cc b/net/ftp/ftp_network_transaction.cc index a391cad..2c22e38 100644 --- a/net/ftp/ftp_network_transaction.cc +++ b/net/ftp/ftp_network_transaction.cc @@ -651,10 +651,10 @@ int FtpNetworkTransaction::DoCtrlConnect() { int FtpNetworkTransaction::DoCtrlConnectComplete(int result) { if (result == OK) { // Put the peer's IP address and port into the response. - AddressList address; - result = ctrl_socket_->GetPeerAddress(&address); + IPEndPoint ip_endpoint; + result = ctrl_socket_->GetPeerAddress(&ip_endpoint); if (result == OK) { - response_.socket_address = HostPortPair::FromIPEndPoint(address.front()); + response_.socket_address = HostPortPair::FromIPEndPoint(ip_endpoint); next_state_ = STATE_CTRL_READ; } } @@ -1188,14 +1188,15 @@ int FtpNetworkTransaction::ProcessResponseQUIT( int FtpNetworkTransaction::DoDataConnect() { next_state_ = STATE_DATA_CONNECT_COMPLETE; + IPEndPoint ip_endpoint; AddressList data_address; // Connect to the same host as the control socket to prevent PASV port // scanning attacks. - int rv = ctrl_socket_->GetPeerAddress(&data_address); + int rv = ctrl_socket_->GetPeerAddress(&ip_endpoint); if (rv != OK) return Stop(rv); data_address = AddressList::CreateFromIPAddress( - data_address.front().address(), data_connection_port_); + ip_endpoint.address(), data_connection_port_); data_socket_.reset(socket_factory_->CreateTransportClientSocket( data_address, net_log_.net_log(), net_log_.source())); return data_socket_->Connect(io_callback_); diff --git a/net/http/http_proxy_client_socket.cc b/net/http/http_proxy_client_socket.cc index f9ba3b8..d801da0 100644 --- a/net/http/http_proxy_client_socket.cc +++ b/net/http/http_proxy_client_socket.cc @@ -245,7 +245,7 @@ bool HttpProxyClientSocket::SetSendBufferSize(int32 size) { return transport_->socket()->SetSendBufferSize(size); } -int HttpProxyClientSocket::GetPeerAddress(AddressList* address) const { +int HttpProxyClientSocket::GetPeerAddress(IPEndPoint* address) const { return transport_->socket()->GetPeerAddress(address); } diff --git a/net/http/http_proxy_client_socket.h b/net/http/http_proxy_client_socket.h index 21d355a..97be970 100644 --- a/net/http/http_proxy_client_socket.h +++ b/net/http/http_proxy_client_socket.h @@ -84,7 +84,7 @@ class HttpProxyClientSocket : public ProxyClientSocket { const CompletionCallback& callback) OVERRIDE; virtual bool SetReceiveBufferSize(int32 size) OVERRIDE; virtual bool SetSendBufferSize(int32 size) OVERRIDE; - virtual int GetPeerAddress(AddressList* address) const OVERRIDE; + virtual int GetPeerAddress(IPEndPoint* address) const OVERRIDE; virtual int GetLocalAddress(IPEndPoint* address) const OVERRIDE; private: diff --git a/net/http/http_stream_parser.cc b/net/http/http_stream_parser.cc index 6c38db7..b56bd08 100644 --- a/net/http/http_stream_parser.cc +++ b/net/http/http_stream_parser.cc @@ -209,11 +209,11 @@ int HttpStreamParser::SendRequest(const std::string& request_line, response_ = response; // Put the peer's IP address and port into the response. - AddressList address; - int result = connection_->socket()->GetPeerAddress(&address); + IPEndPoint ip_endpoint; + int result = connection_->socket()->GetPeerAddress(&ip_endpoint); if (result != OK) return result; - response_->socket_address = HostPortPair::FromIPEndPoint(address.front()); + response_->socket_address = HostPortPair::FromIPEndPoint(ip_endpoint); std::string request = request_line + headers.ToString(); request_body_.reset(request_body); diff --git a/net/socket/buffered_write_stream_socket.cc b/net/socket/buffered_write_stream_socket.cc index 028dfde..ed7ce2e 100644 --- a/net/socket/buffered_write_stream_socket.cc +++ b/net/socket/buffered_write_stream_socket.cc @@ -83,7 +83,7 @@ bool BufferedWriteStreamSocket::IsConnectedAndIdle() const { return wrapped_socket_->IsConnectedAndIdle(); } -int BufferedWriteStreamSocket::GetPeerAddress(AddressList* address) const { +int BufferedWriteStreamSocket::GetPeerAddress(IPEndPoint* address) const { return wrapped_socket_->GetPeerAddress(address); } diff --git a/net/socket/buffered_write_stream_socket.h b/net/socket/buffered_write_stream_socket.h index a02380d..879f5dd 100644 --- a/net/socket/buffered_write_stream_socket.h +++ b/net/socket/buffered_write_stream_socket.h @@ -50,7 +50,7 @@ class NET_EXPORT_PRIVATE BufferedWriteStreamSocket : public StreamSocket { virtual void Disconnect() OVERRIDE; virtual bool IsConnected() const OVERRIDE; virtual bool IsConnectedAndIdle() const OVERRIDE; - virtual int GetPeerAddress(AddressList* address) const OVERRIDE; + virtual int GetPeerAddress(IPEndPoint* address) const OVERRIDE; virtual int GetLocalAddress(IPEndPoint* address) const OVERRIDE; virtual const BoundNetLog& NetLog() const OVERRIDE; virtual void SetSubresourceSpeculation() OVERRIDE; diff --git a/net/socket/client_socket_pool_base_unittest.cc b/net/socket/client_socket_pool_base_unittest.cc index 212438c..c650bff 100644 --- a/net/socket/client_socket_pool_base_unittest.cc +++ b/net/socket/client_socket_pool_base_unittest.cc @@ -93,7 +93,7 @@ class MockClientSocket : public StreamSocket { virtual bool IsConnected() const { return connected_; } virtual bool IsConnectedAndIdle() const { return connected_; } - virtual int GetPeerAddress(AddressList* /* address */) const { + virtual int GetPeerAddress(IPEndPoint* /* address */) const { return ERR_UNEXPECTED; } diff --git a/net/socket/socket_test_util.cc b/net/socket/socket_test_util.cc index 929514f..0608ee2 100644 --- a/net/socket/socket_test_util.cc +++ b/net/socket/socket_test_util.cc @@ -660,11 +660,11 @@ bool MockClientSocket::IsConnectedAndIdle() const { return connected_; } -int MockClientSocket::GetPeerAddress(AddressList* address) const { +int MockClientSocket::GetPeerAddress(IPEndPoint* address) const { IPAddressNumber ip; bool rv = ParseIPLiteralToNumber("192.0.2.33", &ip); CHECK(rv); - *address = AddressList::CreateFromIPAddress(ip, 0); + *address = IPEndPoint(ip, 0); return OK; } @@ -824,7 +824,7 @@ bool MockTCPClientSocket::IsConnectedAndIdle() const { return IsConnected(); } -int MockTCPClientSocket::GetPeerAddress(AddressList* address) const { +int MockTCPClientSocket::GetPeerAddress(IPEndPoint* address) const { if (!IsConnected()) return ERR_SOCKET_NOT_CONNECTED; return MockClientSocket::GetPeerAddress(address); diff --git a/net/socket/socket_test_util.h b/net/socket/socket_test_util.h index a0d0c65..a75c904 100644 --- a/net/socket/socket_test_util.h +++ b/net/socket/socket_test_util.h @@ -589,7 +589,7 @@ class MockClientSocket : public SSLClientSocket { virtual void Disconnect() OVERRIDE; virtual bool IsConnected() const OVERRIDE; virtual bool IsConnectedAndIdle() const OVERRIDE; - virtual int GetPeerAddress(AddressList* address) const OVERRIDE; + virtual int GetPeerAddress(IPEndPoint* address) const OVERRIDE; virtual int GetLocalAddress(IPEndPoint* address) const OVERRIDE; virtual const BoundNetLog& NetLog() const OVERRIDE; virtual void SetSubresourceSpeculation() OVERRIDE {} @@ -640,7 +640,7 @@ class MockTCPClientSocket : public MockClientSocket, public AsyncSocket { virtual void Disconnect() OVERRIDE; virtual bool IsConnected() const OVERRIDE; virtual bool IsConnectedAndIdle() const OVERRIDE; - virtual int GetPeerAddress(AddressList* address) const OVERRIDE; + virtual int GetPeerAddress(IPEndPoint* address) const OVERRIDE; virtual bool WasEverUsed() const OVERRIDE; virtual bool UsingTCPFastOpen() const OVERRIDE; virtual int64 NumBytesRead() const OVERRIDE; diff --git a/net/socket/socks5_client_socket.cc b/net/socket/socks5_client_socket.cc index 5475313..9755756 100644 --- a/net/socket/socks5_client_socket.cc +++ b/net/socket/socks5_client_socket.cc @@ -503,7 +503,7 @@ int SOCKS5ClientSocket::DoHandshakeReadComplete(int result) { return OK; } -int SOCKS5ClientSocket::GetPeerAddress(AddressList* address) const { +int SOCKS5ClientSocket::GetPeerAddress(IPEndPoint* address) const { return transport_->socket()->GetPeerAddress(address); } diff --git a/net/socket/socks5_client_socket.h b/net/socket/socks5_client_socket.h index 09a4f54..e91ef96 100644 --- a/net/socket/socks5_client_socket.h +++ b/net/socket/socks5_client_socket.h @@ -75,7 +75,7 @@ class NET_EXPORT_PRIVATE SOCKS5ClientSocket : public StreamSocket { virtual bool SetReceiveBufferSize(int32 size) OVERRIDE; virtual bool SetSendBufferSize(int32 size) OVERRIDE; - virtual int GetPeerAddress(AddressList* address) const OVERRIDE; + virtual int GetPeerAddress(IPEndPoint* address) const OVERRIDE; virtual int GetLocalAddress(IPEndPoint* address) const OVERRIDE; private: diff --git a/net/socket/socks_client_socket.cc b/net/socket/socks_client_socket.cc index 025d1aa..7a9f2f7 100644 --- a/net/socket/socks_client_socket.cc +++ b/net/socket/socks_client_socket.cc @@ -431,7 +431,7 @@ int SOCKSClientSocket::DoHandshakeReadComplete(int result) { // Note: we ignore the last 6 bytes as specified by the SOCKS protocol } -int SOCKSClientSocket::GetPeerAddress(AddressList* address) const { +int SOCKSClientSocket::GetPeerAddress(IPEndPoint* address) const { return transport_->socket()->GetPeerAddress(address); } diff --git a/net/socket/socks_client_socket.h b/net/socket/socks_client_socket.h index 8dfd773..505dc29 100644 --- a/net/socket/socks_client_socket.h +++ b/net/socket/socks_client_socket.h @@ -72,7 +72,7 @@ class NET_EXPORT_PRIVATE SOCKSClientSocket : public StreamSocket { virtual bool SetReceiveBufferSize(int32 size) OVERRIDE; virtual bool SetSendBufferSize(int32 size) OVERRIDE; - virtual int GetPeerAddress(AddressList* address) const OVERRIDE; + virtual int GetPeerAddress(IPEndPoint* address) const OVERRIDE; virtual int GetLocalAddress(IPEndPoint* address) const OVERRIDE; private: diff --git a/net/socket/ssl_client_socket_mac.cc b/net/socket/ssl_client_socket_mac.cc index 862ef52..fb69726 100644 --- a/net/socket/ssl_client_socket_mac.cc +++ b/net/socket/ssl_client_socket_mac.cc @@ -609,7 +609,7 @@ bool SSLClientSocketMac::IsConnectedAndIdle() const { return completed_handshake() && transport_->socket()->IsConnectedAndIdle(); } -int SSLClientSocketMac::GetPeerAddress(AddressList* address) const { +int SSLClientSocketMac::GetPeerAddress(IPEndPoint* address) const { return transport_->socket()->GetPeerAddress(address); } @@ -884,11 +884,10 @@ int SSLClientSocketMac::InitializeSSLContext() { // using the same hostname (i.e., localhost and 127.0.0.1 are considered // different peers, which puts us through certificate validation again // and catches hostname/certificate name mismatches. - AddressList address; - int rv = transport_->socket()->GetPeerAddress(&address); + IPEndPoint endpoint; + int rv = transport_->socket()->GetPeerAddress(&endpoint); if (rv != OK) return rv; - const IPEndPoint& endpoint = address.front(); std::string peer_id(host_and_port_.ToString()); peer_id += std::string(reinterpret_cast<const char*>(&endpoint.address()[0]), endpoint.address().size()); diff --git a/net/socket/ssl_client_socket_mac.h b/net/socket/ssl_client_socket_mac.h index 4559dd7..363c903 100644 --- a/net/socket/ssl_client_socket_mac.h +++ b/net/socket/ssl_client_socket_mac.h @@ -58,7 +58,7 @@ class SSLClientSocketMac : public SSLClientSocket { virtual void Disconnect() OVERRIDE; virtual bool IsConnected() const OVERRIDE; virtual bool IsConnectedAndIdle() const OVERRIDE; - virtual int GetPeerAddress(AddressList* address) const OVERRIDE; + virtual int GetPeerAddress(IPEndPoint* address) const OVERRIDE; virtual int GetLocalAddress(IPEndPoint* address) const OVERRIDE; virtual const BoundNetLog& NetLog() const OVERRIDE; virtual void SetSubresourceSpeculation() OVERRIDE; diff --git a/net/socket/ssl_client_socket_nss.cc b/net/socket/ssl_client_socket_nss.cc index 125df5d..b27ac44 100644 --- a/net/socket/ssl_client_socket_nss.cc +++ b/net/socket/ssl_client_socket_nss.cc @@ -2982,7 +2982,7 @@ bool SSLClientSocketNSS::IsConnectedAndIdle() const { return ret; } -int SSLClientSocketNSS::GetPeerAddress(AddressList* address) const { +int SSLClientSocketNSS::GetPeerAddress(IPEndPoint* address) const { return transport_->socket()->GetPeerAddress(address); } @@ -3259,13 +3259,13 @@ int SSLClientSocketNSS::InitializeSSLOptions() { int SSLClientSocketNSS::InitializeSSLPeerName() { // Tell NSS who we're connected to - AddressList peer_address; + IPEndPoint peer_address; int err = transport_->socket()->GetPeerAddress(&peer_address); if (err != OK) return err; SockaddrStorage storage; - if (!peer_address.front().ToSockAddr(storage.addr, &storage.addr_len)) + if (!peer_address.ToSockAddr(storage.addr, &storage.addr_len)) return ERR_UNEXPECTED; PRNetAddr peername; diff --git a/net/socket/ssl_client_socket_nss.h b/net/socket/ssl_client_socket_nss.h index 250feaa..9d6dd94 100644 --- a/net/socket/ssl_client_socket_nss.h +++ b/net/socket/ssl_client_socket_nss.h @@ -85,7 +85,7 @@ class SSLClientSocketNSS : public SSLClientSocket { virtual void Disconnect() OVERRIDE; virtual bool IsConnected() const OVERRIDE; virtual bool IsConnectedAndIdle() const OVERRIDE; - virtual int GetPeerAddress(AddressList* address) const OVERRIDE; + virtual int GetPeerAddress(IPEndPoint* address) const OVERRIDE; virtual int GetLocalAddress(IPEndPoint* address) const OVERRIDE; virtual const BoundNetLog& NetLog() const OVERRIDE; virtual void SetSubresourceSpeculation() OVERRIDE; diff --git a/net/socket/ssl_client_socket_openssl.cc b/net/socket/ssl_client_socket_openssl.cc index ba52ec0..d77f883 100644 --- a/net/socket/ssl_client_socket_openssl.cc +++ b/net/socket/ssl_client_socket_openssl.cc @@ -1155,7 +1155,7 @@ bool SSLClientSocketOpenSSL::IsConnectedAndIdle() const { return ret; } -int SSLClientSocketOpenSSL::GetPeerAddress(AddressList* addressList) const { +int SSLClientSocketOpenSSL::GetPeerAddress(IPEndPoint* addressList) const { return transport_->socket()->GetPeerAddress(addressList); } diff --git a/net/socket/ssl_client_socket_openssl.h b/net/socket/ssl_client_socket_openssl.h index 9fc1b22..c8981ed 100644 --- a/net/socket/ssl_client_socket_openssl.h +++ b/net/socket/ssl_client_socket_openssl.h @@ -73,7 +73,7 @@ class SSLClientSocketOpenSSL : public SSLClientSocket { virtual void Disconnect() OVERRIDE; virtual bool IsConnected() const OVERRIDE; virtual bool IsConnectedAndIdle() const OVERRIDE; - virtual int GetPeerAddress(AddressList* address) const OVERRIDE; + virtual int GetPeerAddress(IPEndPoint* address) const OVERRIDE; virtual int GetLocalAddress(IPEndPoint* address) const OVERRIDE; virtual const BoundNetLog& NetLog() const OVERRIDE; virtual void SetSubresourceSpeculation() OVERRIDE; diff --git a/net/socket/ssl_client_socket_win.cc b/net/socket/ssl_client_socket_win.cc index 8728532..5b27670 100644 --- a/net/socket/ssl_client_socket_win.cc +++ b/net/socket/ssl_client_socket_win.cc @@ -711,7 +711,7 @@ bool SSLClientSocketWin::IsConnectedAndIdle() const { return completed_handshake() && transport_->socket()->IsConnectedAndIdle(); } -int SSLClientSocketWin::GetPeerAddress(AddressList* address) const { +int SSLClientSocketWin::GetPeerAddress(IPEndPoint* address) const { return transport_->socket()->GetPeerAddress(address); } diff --git a/net/socket/ssl_client_socket_win.h b/net/socket/ssl_client_socket_win.h index e9a74fe..a215384 100644 --- a/net/socket/ssl_client_socket_win.h +++ b/net/socket/ssl_client_socket_win.h @@ -62,7 +62,7 @@ class SSLClientSocketWin : public SSLClientSocket { virtual void Disconnect() OVERRIDE; virtual bool IsConnected() const OVERRIDE; virtual bool IsConnectedAndIdle() const OVERRIDE; - virtual int GetPeerAddress(AddressList* address) const OVERRIDE; + virtual int GetPeerAddress(IPEndPoint* address) const OVERRIDE; virtual int GetLocalAddress(IPEndPoint* address) const OVERRIDE; virtual const BoundNetLog& NetLog() const OVERRIDE{ return net_log_; } virtual void SetSubresourceSpeculation() OVERRIDE; diff --git a/net/socket/ssl_server_socket_nss.cc b/net/socket/ssl_server_socket_nss.cc index 8fa246a..2d7635d 100644 --- a/net/socket/ssl_server_socket_nss.cc +++ b/net/socket/ssl_server_socket_nss.cc @@ -205,7 +205,7 @@ bool SSLServerSocketNSS::IsConnectedAndIdle() const { return completed_handshake_ && transport_socket_->IsConnectedAndIdle(); } -int SSLServerSocketNSS::GetPeerAddress(AddressList* address) const { +int SSLServerSocketNSS::GetPeerAddress(IPEndPoint* address) const { if (!IsConnected()) return ERR_SOCKET_NOT_CONNECTED; return transport_socket_->GetPeerAddress(address); diff --git a/net/socket/ssl_server_socket_nss.h b/net/socket/ssl_server_socket_nss.h index aefb584..b2fcb2c 100644 --- a/net/socket/ssl_server_socket_nss.h +++ b/net/socket/ssl_server_socket_nss.h @@ -52,7 +52,7 @@ class SSLServerSocketNSS : public SSLServerSocket { virtual void Disconnect() OVERRIDE; virtual bool IsConnected() const OVERRIDE; virtual bool IsConnectedAndIdle() const OVERRIDE; - virtual int GetPeerAddress(AddressList* address) const OVERRIDE; + virtual int GetPeerAddress(IPEndPoint* address) const OVERRIDE; virtual int GetLocalAddress(IPEndPoint* address) const OVERRIDE; virtual const BoundNetLog& NetLog() const OVERRIDE; virtual void SetSubresourceSpeculation() OVERRIDE; diff --git a/net/socket/ssl_server_socket_unittest.cc b/net/socket/ssl_server_socket_unittest.cc index 806a598..9cbbb42 100644 --- a/net/socket/ssl_server_socket_unittest.cc +++ b/net/socket/ssl_server_socket_unittest.cc @@ -201,9 +201,9 @@ class FakeSocket : public StreamSocket { return true; } - virtual int GetPeerAddress(AddressList* address) const OVERRIDE { - net::IPAddressNumber ip_address(4); - *address = net::AddressList::CreateFromIPAddress(ip_address, 0 /*port*/); + virtual int GetPeerAddress(IPEndPoint* address) const OVERRIDE { + net::IPAddressNumber ip_address(net::kIPv4AddressSize); + *address = net::IPEndPoint(ip_address, 0 /*port*/); return net::OK; } diff --git a/net/socket/stream_socket.h b/net/socket/stream_socket.h index 4d7b7e2..cc3c19e 100644 --- a/net/socket/stream_socket.h +++ b/net/socket/stream_socket.h @@ -57,7 +57,7 @@ class NET_EXPORT_PRIVATE StreamSocket : public Socket { // Copies the peer address to |address| and returns a network error code. // ERR_SOCKET_NOT_CONNECTED will be returned if the socket is not connected. // TODO(sergeyu): Use IPEndPoint instead of AddressList. - virtual int GetPeerAddress(AddressList* address) const = 0; + virtual int GetPeerAddress(IPEndPoint* address) const = 0; // Copies the local address to |address| and returns a network error code. // ERR_SOCKET_NOT_CONNECTED will be returned if the socket is not connected. diff --git a/net/socket/tcp_client_socket_libevent.cc b/net/socket/tcp_client_socket_libevent.cc index 2bb0e02..5b71f6b 100644 --- a/net/socket/tcp_client_socket_libevent.cc +++ b/net/socket/tcp_client_socket_libevent.cc @@ -713,12 +713,12 @@ void TCPClientSocketLibevent::DidCompleteWrite() { } } -int TCPClientSocketLibevent::GetPeerAddress(AddressList* address) const { +int TCPClientSocketLibevent::GetPeerAddress(IPEndPoint* address) const { DCHECK(CalledOnValidThread()); DCHECK(address); if (!IsConnected()) return ERR_SOCKET_NOT_CONNECTED; - *address = AddressList(addresses_[current_address_index_]); + *address = addresses_[current_address_index_]; return OK; } diff --git a/net/socket/tcp_client_socket_libevent.h b/net/socket/tcp_client_socket_libevent.h index f66c8c1..5441f5a 100644 --- a/net/socket/tcp_client_socket_libevent.h +++ b/net/socket/tcp_client_socket_libevent.h @@ -47,7 +47,7 @@ class NET_EXPORT_PRIVATE TCPClientSocketLibevent : public StreamSocket, virtual void Disconnect() OVERRIDE; virtual bool IsConnected() const OVERRIDE; virtual bool IsConnectedAndIdle() const OVERRIDE; - virtual int GetPeerAddress(AddressList* address) const OVERRIDE; + virtual int GetPeerAddress(IPEndPoint* address) const OVERRIDE; virtual int GetLocalAddress(IPEndPoint* address) const OVERRIDE; virtual const BoundNetLog& NetLog() const OVERRIDE; virtual void SetSubresourceSpeculation() OVERRIDE; diff --git a/net/socket/tcp_client_socket_win.cc b/net/socket/tcp_client_socket_win.cc index 05578b0..3ccad12 100644 --- a/net/socket/tcp_client_socket_win.cc +++ b/net/socket/tcp_client_socket_win.cc @@ -636,12 +636,12 @@ bool TCPClientSocketWin::IsConnectedAndIdle() const { return true; } -int TCPClientSocketWin::GetPeerAddress(AddressList* address) const { +int TCPClientSocketWin::GetPeerAddress(IPEndPoint* address) const { DCHECK(CalledOnValidThread()); DCHECK(address); if (!IsConnected()) return ERR_SOCKET_NOT_CONNECTED; - *address = AddressList(addresses_[current_address_index_]); + *address = addresses_[current_address_index_]; return OK; } diff --git a/net/socket/tcp_client_socket_win.h b/net/socket/tcp_client_socket_win.h index 14720ae..4ca5e30 100644 --- a/net/socket/tcp_client_socket_win.h +++ b/net/socket/tcp_client_socket_win.h @@ -46,7 +46,7 @@ class NET_EXPORT TCPClientSocketWin : public StreamSocket, virtual void Disconnect(); virtual bool IsConnected() const; virtual bool IsConnectedAndIdle() const; - virtual int GetPeerAddress(AddressList* address) const; + virtual int GetPeerAddress(IPEndPoint* address) const; virtual int GetLocalAddress(IPEndPoint* address) const; virtual const BoundNetLog& NetLog() const { return net_log_; } virtual void SetSubresourceSpeculation(); diff --git a/net/socket/tcp_server_socket_unittest.cc b/net/socket/tcp_server_socket_unittest.cc index a384b70..62f3f37 100644 --- a/net/socket/tcp_server_socket_unittest.cc +++ b/net/socket/tcp_server_socket_unittest.cc @@ -59,9 +59,9 @@ class TCPServerSocketTest : public PlatformTest { } static IPEndPoint GetPeerAddress(StreamSocket* socket) { - AddressList address; + IPEndPoint address; EXPECT_EQ(OK, socket->GetPeerAddress(&address)); - return address.front(); + return address; } AddressList local_address_list() const { diff --git a/net/socket/transport_client_socket_pool_unittest.cc b/net/socket/transport_client_socket_pool_unittest.cc index c335e33..b1fb87a 100644 --- a/net/socket/transport_client_socket_pool_unittest.cc +++ b/net/socket/transport_client_socket_pool_unittest.cc @@ -66,7 +66,7 @@ class MockClientSocket : public StreamSocket { virtual bool IsConnectedAndIdle() const { return connected_; } - virtual int GetPeerAddress(AddressList* address) const { + virtual int GetPeerAddress(IPEndPoint* address) const { return ERR_UNEXPECTED; } virtual int GetLocalAddress(IPEndPoint* address) const { @@ -129,7 +129,7 @@ class MockFailingClientSocket : public StreamSocket { virtual bool IsConnectedAndIdle() const { return false; } - virtual int GetPeerAddress(AddressList* address) const { + virtual int GetPeerAddress(IPEndPoint* address) const { return ERR_UNEXPECTED; } virtual int GetLocalAddress(IPEndPoint* address) const { @@ -205,7 +205,7 @@ class MockPendingClientSocket : public StreamSocket { virtual bool IsConnectedAndIdle() const { return is_connected_; } - virtual int GetPeerAddress(AddressList* address) const { + virtual int GetPeerAddress(IPEndPoint* address) const { return ERR_UNEXPECTED; } virtual int GetLocalAddress(IPEndPoint* address) const { diff --git a/net/spdy/spdy_http_stream.cc b/net/spdy/spdy_http_stream.cc index 9a498b9..9af52e4 100644 --- a/net/spdy/spdy_http_stream.cc +++ b/net/spdy/spdy_http_stream.cc @@ -250,12 +250,11 @@ int SpdyHttpStream::SendRequest(const HttpRequestHeaders& request_headers, response_info_ = response; // Put the peer's IP address and port into the response. - AddressList address; + IPEndPoint address; int result = stream_->GetPeerAddress(&address); if (result != OK) return result; - response_info_->socket_address = - HostPortPair::FromIPEndPoint(address.front()); + response_info_->socket_address = HostPortPair::FromIPEndPoint(address); bool has_upload_data = request_body_stream_.get() != NULL; result = stream_->SendRequest(has_upload_data); diff --git a/net/spdy/spdy_proxy_client_socket.cc b/net/spdy/spdy_proxy_client_socket.cc index 6a1076e..62dcd5e 100644 --- a/net/spdy/spdy_proxy_client_socket.cc +++ b/net/spdy/spdy_proxy_client_socket.cc @@ -275,7 +275,7 @@ bool SpdyProxyClientSocket::SetSendBufferSize(int32 size) { return false; } -int SpdyProxyClientSocket::GetPeerAddress(AddressList* address) const { +int SpdyProxyClientSocket::GetPeerAddress(IPEndPoint* address) const { if (!IsConnected()) return ERR_SOCKET_NOT_CONNECTED; return spdy_stream_->GetPeerAddress(address); diff --git a/net/spdy/spdy_proxy_client_socket.h b/net/spdy/spdy_proxy_client_socket.h index fe0ca77..9c6333c 100644 --- a/net/spdy/spdy_proxy_client_socket.h +++ b/net/spdy/spdy_proxy_client_socket.h @@ -86,7 +86,7 @@ class NET_EXPORT_PRIVATE SpdyProxyClientSocket : public ProxyClientSocket, const CompletionCallback& callback) OVERRIDE; virtual bool SetReceiveBufferSize(int32 size) OVERRIDE; virtual bool SetSendBufferSize(int32 size) OVERRIDE; - virtual int GetPeerAddress(AddressList* address) const OVERRIDE; + virtual int GetPeerAddress(IPEndPoint* address) const OVERRIDE; virtual int GetLocalAddress(IPEndPoint* address) const OVERRIDE; // SpdyStream::Delegate implementation. diff --git a/net/spdy/spdy_proxy_client_socket_spdy2_unittest.cc b/net/spdy/spdy_proxy_client_socket_spdy2_unittest.cc index e0deb42..1eb6c93 100644 --- a/net/spdy/spdy_proxy_client_socket_spdy2_unittest.cc +++ b/net/spdy/spdy_proxy_client_socket_spdy2_unittest.cc @@ -551,7 +551,7 @@ TEST_F(SpdyProxyClientSocketSpdy2Test, GetPeerAddressReturnsCorrectValues) { Initialize(reads, arraysize(reads), writes, arraysize(writes)); - net::AddressList addr; + net::IPEndPoint addr; EXPECT_EQ(ERR_SOCKET_NOT_CONNECTED, sock_->GetPeerAddress(&addr)); AssertConnectSucceeds(); diff --git a/net/spdy/spdy_proxy_client_socket_spdy3_unittest.cc b/net/spdy/spdy_proxy_client_socket_spdy3_unittest.cc index 7ae2140..5299c21 100644 --- a/net/spdy/spdy_proxy_client_socket_spdy3_unittest.cc +++ b/net/spdy/spdy_proxy_client_socket_spdy3_unittest.cc @@ -554,7 +554,7 @@ TEST_F(SpdyProxyClientSocketSpdy3Test, GetPeerAddressReturnsCorrectValues) { Initialize(reads, arraysize(reads), writes, arraysize(writes)); - net::AddressList addr; + net::IPEndPoint addr; EXPECT_EQ(ERR_SOCKET_NOT_CONNECTED, sock_->GetPeerAddress(&addr)); AssertConnectSucceeds(); diff --git a/net/spdy/spdy_session.cc b/net/spdy/spdy_session.cc index 6c84784..60817fa 100644 --- a/net/spdy/spdy_session.cc +++ b/net/spdy/spdy_session.cc @@ -1212,7 +1212,7 @@ bool SpdySession::IsReused() const { return buffered_spdy_framer_->frames_received() > 0; } -int SpdySession::GetPeerAddress(AddressList* address) const { +int SpdySession::GetPeerAddress(IPEndPoint* address) const { if (!connection_->socket()) return ERR_SOCKET_NOT_CONNECTED; diff --git a/net/spdy/spdy_session.h b/net/spdy/spdy_session.h index 220c237..fb3f557 100644 --- a/net/spdy/spdy_session.h +++ b/net/spdy/spdy_session.h @@ -303,7 +303,7 @@ class NET_EXPORT SpdySession : public base::RefCounted<SpdySession>, const BoundNetLog& net_log() const { return net_log_; } - int GetPeerAddress(AddressList* address) const; + int GetPeerAddress(IPEndPoint* address) const; int GetLocalAddress(IPEndPoint* address) const; // Returns true if requests on this session require credentials. diff --git a/net/spdy/spdy_session_pool.cc b/net/spdy/spdy_session_pool.cc index 7fc617e..22bf6eb 100644 --- a/net/spdy/spdy_session_pool.cc +++ b/net/spdy/spdy_session_pool.cc @@ -170,9 +170,9 @@ net::Error SpdySessionPool::GetSpdySessionFromSocket( // proxy's address instead of the origin server, check to see if this is a // direct connection. if (g_enable_ip_pooling && host_port_proxy_pair.second.is_direct()) { - AddressList addresses; - if (connection->socket()->GetPeerAddress(&addresses) == OK) - AddAlias(addresses.front(), host_port_proxy_pair); + IPEndPoint address; + if (connection->socket()->GetPeerAddress(&address) == OK) + AddAlias(address, host_port_proxy_pair); } // Now we can initialize the session with the SSL socket. diff --git a/net/spdy/spdy_stream.cc b/net/spdy/spdy_stream.cc index 2698603..458badb 100644 --- a/net/spdy/spdy_stream.cc +++ b/net/spdy/spdy_stream.cc @@ -284,7 +284,7 @@ void SpdyStream::DecreaseRecvWindowSize(int32 delta_window_size) { } } -int SpdyStream::GetPeerAddress(AddressList* address) const { +int SpdyStream::GetPeerAddress(IPEndPoint* address) const { return session_->GetPeerAddress(address); } diff --git a/net/spdy/spdy_stream.h b/net/spdy/spdy_stream.h index 3e81ecf..8a0c83f 100644 --- a/net/spdy/spdy_stream.h +++ b/net/spdy/spdy_stream.h @@ -157,7 +157,7 @@ class NET_EXPORT_PRIVATE SpdyStream // Decreases |send_window_size_| by the given number of bytes. void DecreaseSendWindowSize(int32 delta_window_size); - int GetPeerAddress(AddressList* address) const; + int GetPeerAddress(IPEndPoint* address) const; int GetLocalAddress(IPEndPoint* address) const; // Returns true if the underlying transport socket ever had any reads or diff --git a/remoting/jingle_glue/ssl_socket_adapter.cc b/remoting/jingle_glue/ssl_socket_adapter.cc index b6b530d..9e5ef86 100644 --- a/remoting/jingle_glue/ssl_socket_adapter.cc +++ b/remoting/jingle_glue/ssl_socket_adapter.cc @@ -217,11 +217,9 @@ bool TransportSocket::IsConnectedAndIdle() const { return false; } -int TransportSocket::GetPeerAddress(net::AddressList* address) const { +int TransportSocket::GetPeerAddress(net::IPEndPoint* address) const { talk_base::SocketAddress socket_address = socket_->GetRemoteAddress(); - net::IPEndPoint endpoint; - if (jingle_glue::SocketAddressToIPEndPoint(socket_address, &endpoint)) { - *address = net::AddressList(endpoint); + if (jingle_glue::SocketAddressToIPEndPoint(socket_address, address)) { return net::OK; } else { return net::ERR_FAILED; diff --git a/remoting/jingle_glue/ssl_socket_adapter.h b/remoting/jingle_glue/ssl_socket_adapter.h index 24b0e05..dee1d18 100644 --- a/remoting/jingle_glue/ssl_socket_adapter.h +++ b/remoting/jingle_glue/ssl_socket_adapter.h @@ -44,7 +44,7 @@ class TransportSocket : public net::StreamSocket, public sigslot::has_slots<> { virtual void Disconnect() OVERRIDE; virtual bool IsConnected() const OVERRIDE; virtual bool IsConnectedAndIdle() const OVERRIDE; - virtual int GetPeerAddress(net::AddressList* address) const OVERRIDE; + virtual int GetPeerAddress(net::IPEndPoint* address) const OVERRIDE; virtual int GetLocalAddress(net::IPEndPoint* address) const OVERRIDE; virtual const net::BoundNetLog& NetLog() const OVERRIDE; virtual void SetSubresourceSpeculation() OVERRIDE; diff --git a/remoting/protocol/fake_session.cc b/remoting/protocol/fake_session.cc index 8f71795..30a6ddb 100644 --- a/remoting/protocol/fake_session.cc +++ b/remoting/protocol/fake_session.cc @@ -113,15 +113,13 @@ bool FakeSocket::IsConnectedAndIdle() const { return false; } -int FakeSocket::GetPeerAddress(net::AddressList* address) const { - net::IPAddressNumber ip; - ip.resize(net::kIPv4AddressSize); - *address = net::AddressList::CreateFromIPAddress(ip, 0); +int FakeSocket::GetPeerAddress(net::IPEndPoint* address) const { + net::IPAddressNumber ip(net::kIPv4AddressSize); + *address = net::IPEndPoint(ip, 0); return net::OK; } -int FakeSocket::GetLocalAddress( - net::IPEndPoint* address) const { +int FakeSocket::GetLocalAddress(net::IPEndPoint* address) const { NOTIMPLEMENTED(); return net::ERR_FAILED; } diff --git a/remoting/protocol/fake_session.h b/remoting/protocol/fake_session.h index 70bcfa1..fb8f031 100644 --- a/remoting/protocol/fake_session.h +++ b/remoting/protocol/fake_session.h @@ -59,7 +59,7 @@ class FakeSocket : public net::StreamSocket { virtual void Disconnect() OVERRIDE; virtual bool IsConnected() const OVERRIDE; virtual bool IsConnectedAndIdle() const OVERRIDE; - virtual int GetPeerAddress(net::AddressList* address) const OVERRIDE; + virtual int GetPeerAddress(net::IPEndPoint* address) const OVERRIDE; virtual int GetLocalAddress(net::IPEndPoint* address) const OVERRIDE; virtual const net::BoundNetLog& NetLog() const OVERRIDE; virtual void SetSubresourceSpeculation() OVERRIDE; |