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

Side by Side Diff: net/socket/server_socket.cc

Issue 1676023002: Make IPAddress::FromIPLiteral a member function. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/socket/server_socket.h" 5 #include "net/socket/server_socket.h"
6 6
7 #include "net/base/ip_address.h" 7 #include "net/base/ip_address.h"
8 #include "net/base/ip_endpoint.h" 8 #include "net/base/ip_endpoint.h"
9 #include "net/base/net_errors.h" 9 #include "net/base/net_errors.h"
10 10
11 namespace net { 11 namespace net {
12 12
13 ServerSocket::ServerSocket() { 13 ServerSocket::ServerSocket() {
14 } 14 }
15 15
16 ServerSocket::~ServerSocket() { 16 ServerSocket::~ServerSocket() {
17 } 17 }
18 18
19 int ServerSocket::ListenWithAddressAndPort(const std::string& address_string, 19 int ServerSocket::ListenWithAddressAndPort(const std::string& address_string,
20 uint16_t port, 20 uint16_t port,
21 int backlog) { 21 int backlog) {
22 IPAddress ip_address; 22 IPAddress ip_address;
23 if (!IPAddress::FromIPLiteral(address_string, &ip_address)) { 23 if (!ip_address.AssignFromIPLiteral(address_string)) {
24 return ERR_ADDRESS_INVALID; 24 return ERR_ADDRESS_INVALID;
25 } 25 }
26 26
27 return Listen(IPEndPoint(ip_address, port), backlog); 27 return Listen(IPEndPoint(ip_address, port), backlog);
28 } 28 }
29 29
30 } // namespace net 30 } // namespace net
OLDNEW
« net/base/ip_address_unittest.cc ('K') | « net/http/http_transaction_test_util.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698