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

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

Issue 1540413002: net: add a ctor to IPEndPoint that takes an 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
« no previous file with comments | « no previous file | net/base/ip_endpoint.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
31 // DEPRECATED(crbug.com/496258): Use the ctor that takes IPAddress instead.
29 IPEndPoint(const IPAddressNumber& address, uint16_t port); 32 IPEndPoint(const IPAddressNumber& address, uint16_t port);
33 IPEndPoint(const IPAddress& address, uint16_t port);
30 IPEndPoint(const IPEndPoint& endpoint); 34 IPEndPoint(const IPEndPoint& endpoint);
31 35
32 const IPAddressNumber& address() const { return address_; } 36 const IPAddressNumber& address() const { return address_; }
33 uint16_t port() const { return port_; } 37 uint16_t port() const { return port_; }
34 38
35 // Returns AddressFamily of the address. 39 // Returns AddressFamily of the address.
36 AddressFamily GetFamily() const; 40 AddressFamily GetFamily() const;
37 41
38 // Returns the sockaddr family of the address, AF_INET or AF_INET6. 42 // Returns the sockaddr family of the address, AF_INET or AF_INET6.
39 int GetSockAddrFamily() const; 43 int GetSockAddrFamily() const;
(...skipping 26 matching lines...) Expand all
66 bool operator==(const IPEndPoint& that) const; 70 bool operator==(const IPEndPoint& that) const;
67 71
68 private: 72 private:
69 IPAddressNumber address_; 73 IPAddressNumber address_;
70 uint16_t port_; 74 uint16_t port_;
71 }; 75 };
72 76
73 } // namespace net 77 } // namespace net
74 78
75 #endif // NET_BASE_IP_ENDPOINT_H_ 79 #endif // NET_BASE_IP_ENDPOINT_H_
OLDNEW
« no previous file with comments | « no previous file | net/base/ip_endpoint.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698