summaryrefslogtreecommitdiffstats
path: root/net/socket
diff options
context:
space:
mode:
authortfarina <tfarina@chromium.org>2016-02-04 01:53:02 -0800
committerCommit bot <commit-bot@chromium.org>2016-02-04 09:54:32 +0000
commit0f002fc8a9a7cda66f840ca12e07d96811d9b063 (patch)
tree9d3570421df5507db491512ad34df226dddaa7f4 /net/socket
parent90f599d0866263d007607428911e527598dbd585 (diff)
downloadchromium_src-0f002fc8a9a7cda66f840ca12e07d96811d9b063.zip
chromium_src-0f002fc8a9a7cda66f840ca12e07d96811d9b063.tar.gz
chromium_src-0f002fc8a9a7cda66f840ca12e07d96811d9b063.tar.bz2
net: change ListenWithAddressAndPort() to use IPAddress class
This patch changes ServerSocket::ListenWithAddressAndPort() member function to make use of the new IPAddress class and its FromIPLiteral helper method. By changing to IPAddress we end up using the non-deprecated constructor of IPEndPoint, which is also good. This patch also removes an unused net_util.h include. BUG=488531,496258 TEST=net_unittests R=mmenke@chromium.org,eroman@chromium.org Review URL: https://codereview.chromium.org/1655393005 Cr-Commit-Position: refs/heads/master@{#373494}
Diffstat (limited to 'net/socket')
-rw-r--r--net/socket/server_socket.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/net/socket/server_socket.cc b/net/socket/server_socket.cc
index 50722a9..15a87c1 100644
--- a/net/socket/server_socket.cc
+++ b/net/socket/server_socket.cc
@@ -4,9 +4,9 @@
#include "net/socket/server_socket.h"
+#include "net/base/ip_address.h"
#include "net/base/ip_endpoint.h"
#include "net/base/net_errors.h"
-#include "net/base/net_util.h"
namespace net {
@@ -19,12 +19,12 @@ ServerSocket::~ServerSocket() {
int ServerSocket::ListenWithAddressAndPort(const std::string& address_string,
uint16_t port,
int backlog) {
- IPAddressNumber address_number;
- if (!ParseIPLiteralToNumber(address_string, &address_number)) {
+ IPAddress ip_address;
+ if (!IPAddress::FromIPLiteral(address_string, &ip_address)) {
return ERR_ADDRESS_INVALID;
}
- return Listen(IPEndPoint(address_number, port), backlog);
+ return Listen(IPEndPoint(ip_address, port), backlog);
}
} // namespace net