summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
Diffstat (limited to 'net')
-rw-r--r--net/curvecp/curvecp_client_socket.cc4
-rw-r--r--net/curvecp/curvecp_client_socket.h2
-rw-r--r--net/ftp/ftp_network_transaction.cc11
-rw-r--r--net/http/http_proxy_client_socket.cc2
-rw-r--r--net/http/http_proxy_client_socket.h2
-rw-r--r--net/http/http_stream_parser.cc6
-rw-r--r--net/socket/buffered_write_stream_socket.cc2
-rw-r--r--net/socket/buffered_write_stream_socket.h2
-rw-r--r--net/socket/client_socket_pool_base_unittest.cc2
-rw-r--r--net/socket/socket_test_util.cc6
-rw-r--r--net/socket/socket_test_util.h4
-rw-r--r--net/socket/socks5_client_socket.cc2
-rw-r--r--net/socket/socks5_client_socket.h2
-rw-r--r--net/socket/socks_client_socket.cc2
-rw-r--r--net/socket/socks_client_socket.h2
-rw-r--r--net/socket/ssl_client_socket_mac.cc7
-rw-r--r--net/socket/ssl_client_socket_mac.h2
-rw-r--r--net/socket/ssl_client_socket_nss.cc6
-rw-r--r--net/socket/ssl_client_socket_nss.h2
-rw-r--r--net/socket/ssl_client_socket_openssl.cc2
-rw-r--r--net/socket/ssl_client_socket_openssl.h2
-rw-r--r--net/socket/ssl_client_socket_win.cc2
-rw-r--r--net/socket/ssl_client_socket_win.h2
-rw-r--r--net/socket/ssl_server_socket_nss.cc2
-rw-r--r--net/socket/ssl_server_socket_nss.h2
-rw-r--r--net/socket/ssl_server_socket_unittest.cc6
-rw-r--r--net/socket/stream_socket.h2
-rw-r--r--net/socket/tcp_client_socket_libevent.cc4
-rw-r--r--net/socket/tcp_client_socket_libevent.h2
-rw-r--r--net/socket/tcp_client_socket_win.cc4
-rw-r--r--net/socket/tcp_client_socket_win.h2
-rw-r--r--net/socket/tcp_server_socket_unittest.cc4
-rw-r--r--net/socket/transport_client_socket_pool_unittest.cc6
-rw-r--r--net/spdy/spdy_http_stream.cc5
-rw-r--r--net/spdy/spdy_proxy_client_socket.cc2
-rw-r--r--net/spdy/spdy_proxy_client_socket.h2
-rw-r--r--net/spdy/spdy_proxy_client_socket_spdy2_unittest.cc2
-rw-r--r--net/spdy/spdy_proxy_client_socket_spdy3_unittest.cc2
-rw-r--r--net/spdy/spdy_session.cc2
-rw-r--r--net/spdy/spdy_session.h2
-rw-r--r--net/spdy/spdy_session_pool.cc6
-rw-r--r--net/spdy/spdy_stream.cc2
-rw-r--r--net/spdy/spdy_stream.h2
43 files changed, 68 insertions, 69 deletions
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