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

Side by Side Diff: net/base/ip_endpoint.h

Issue 1534583002: Migrate Local Discovery from net::IPAddressNumber to net::IPAddress. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #ifndef NET_BASE_IP_ENDPOINT_H_ 5 #ifndef NET_BASE_IP_ENDPOINT_H_
6 #define NET_BASE_IP_ENDPOINT_H_ 6 #define NET_BASE_IP_ENDPOINT_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <string> 10 #include <string>
11 11
12 #include "base/compiler_specific.h" 12 #include "base/compiler_specific.h"
13 #include "net/base/address_family.h" 13 #include "net/base/address_family.h"
14 #include "net/base/ip_address_number.h" 14 #include "net/base/ip_address_number.h"
15 #include "net/base/net_export.h" 15 #include "net/base/net_export.h"
16 #include "net/base/sys_addrinfo.h" 16 #include "net/base/sys_addrinfo.h"
17 17
18 struct sockaddr; 18 struct sockaddr;
19 19
20 namespace net { 20 namespace net {
21 21
22 class IPAddress;
23
22 // An IPEndPoint represents the address of a transport endpoint: 24 // An IPEndPoint represents the address of a transport endpoint:
23 // * IP address (either v4 or v6) 25 // * IP address (either v4 or v6)
24 // * Port 26 // * Port
25 class NET_EXPORT IPEndPoint { 27 class NET_EXPORT IPEndPoint {
26 public: 28 public:
27 IPEndPoint(); 29 IPEndPoint();
28 ~IPEndPoint(); 30 ~IPEndPoint();
29 IPEndPoint(const IPAddressNumber& address, uint16_t port); 31 IPEndPoint(const IPAddressNumber& address, uint16_t port);
32 IPEndPoint(const IPAddress& address, uint16_t port);
tfarina 2015/12/21 23:13:36 Eric, is it a good idea to make this change separa
eroman 2015/12/21 23:25:04 Yes. In fact a number of my recommendations make s
tfarina 2015/12/22 00:20:34 I have made it separately. https://codereview.chr
30 IPEndPoint(const IPEndPoint& endpoint); 33 IPEndPoint(const IPEndPoint& endpoint);
31 34
32 const IPAddressNumber& address() const { return address_; } 35 const IPAddressNumber& address() const { return address_; }
33 uint16_t port() const { return port_; } 36 uint16_t port() const { return port_; }
34 37
35 // Returns AddressFamily of the address. 38 // Returns AddressFamily of the address.
36 AddressFamily GetFamily() const; 39 AddressFamily GetFamily() const;
37 40
38 // Returns the sockaddr family of the address, AF_INET or AF_INET6. 41 // Returns the sockaddr family of the address, AF_INET or AF_INET6.
39 int GetSockAddrFamily() const; 42 int GetSockAddrFamily() const;
(...skipping 26 matching lines...) Expand all
66 bool operator==(const IPEndPoint& that) const; 69 bool operator==(const IPEndPoint& that) const;
67 70
68 private: 71 private:
69 IPAddressNumber address_; 72 IPAddressNumber address_;
70 uint16_t port_; 73 uint16_t port_;
71 }; 74 };
72 75
73 } // namespace net 76 } // namespace net
74 77
75 #endif // NET_BASE_IP_ENDPOINT_H_ 78 #endif // NET_BASE_IP_ENDPOINT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698