OLD | NEW |
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_ADDRESS_LIST_H_ | 5 #ifndef NET_BASE_ADDRESS_LIST_H_ |
6 #define NET_BASE_ADDRESS_LIST_H_ | 6 #define NET_BASE_ADDRESS_LIST_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 11 matching lines...) Expand all Loading... |
22 class NET_EXPORT AddressList | 22 class NET_EXPORT AddressList |
23 : NON_EXPORTED_BASE(private std::vector<IPEndPoint>) { | 23 : NON_EXPORTED_BASE(private std::vector<IPEndPoint>) { |
24 public: | 24 public: |
25 AddressList(); | 25 AddressList(); |
26 ~AddressList(); | 26 ~AddressList(); |
27 | 27 |
28 // Creates an address list for a single IP literal. | 28 // Creates an address list for a single IP literal. |
29 explicit AddressList(const IPEndPoint& endpoint); | 29 explicit AddressList(const IPEndPoint& endpoint); |
30 | 30 |
31 static AddressList CreateFromIPAddress(const IPAddressNumber& address, | 31 static AddressList CreateFromIPAddress(const IPAddressNumber& address, |
32 uint16 port); | 32 uint16_t port); |
33 | 33 |
34 static AddressList CreateFromIPAddressList( | 34 static AddressList CreateFromIPAddressList( |
35 const IPAddressList& addresses, | 35 const IPAddressList& addresses, |
36 const std::string& canonical_name); | 36 const std::string& canonical_name); |
37 | 37 |
38 // Copies the data from |head| and the chained list into an AddressList. | 38 // Copies the data from |head| and the chained list into an AddressList. |
39 static AddressList CreateFromAddrinfo(const struct addrinfo* head); | 39 static AddressList CreateFromAddrinfo(const struct addrinfo* head); |
40 | 40 |
41 // Returns a copy of |list| with port on each element set to |port|. | 41 // Returns a copy of |list| with port on each element set to |port|. |
42 static AddressList CopyWithPort(const AddressList& list, uint16 port); | 42 static AddressList CopyWithPort(const AddressList& list, uint16_t port); |
43 | 43 |
44 // TODO(szym): Remove all three. http://crbug.com/126134 | 44 // TODO(szym): Remove all three. http://crbug.com/126134 |
45 const std::string& canonical_name() const { | 45 const std::string& canonical_name() const { |
46 return canonical_name_; | 46 return canonical_name_; |
47 } | 47 } |
48 | 48 |
49 void set_canonical_name(const std::string& canonical_name) { | 49 void set_canonical_name(const std::string& canonical_name) { |
50 canonical_name_ = canonical_name; | 50 canonical_name_ = canonical_name; |
51 } | 51 } |
52 | 52 |
(...skipping 25 matching lines...) Expand all Loading... |
78 using std::vector<IPEndPoint>::rend; | 78 using std::vector<IPEndPoint>::rend; |
79 | 79 |
80 private: | 80 private: |
81 // TODO(szym): Remove. http://crbug.com/126134 | 81 // TODO(szym): Remove. http://crbug.com/126134 |
82 std::string canonical_name_; | 82 std::string canonical_name_; |
83 }; | 83 }; |
84 | 84 |
85 } // namespace net | 85 } // namespace net |
86 | 86 |
87 #endif // NET_BASE_ADDRESS_LIST_H_ | 87 #endif // NET_BASE_ADDRESS_LIST_H_ |
OLD | NEW |