| 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "base/basictypes.h" | 12 #include "base/basictypes.h" |
| 13 #include "base/compiler_specific.h" |
| 13 #include "net/base/ip_endpoint.h" | 14 #include "net/base/ip_endpoint.h" |
| 14 #include "net/base/net_export.h" | 15 #include "net/base/net_export.h" |
| 15 #include "net/base/net_util.h" | 16 #include "net/base/net_util.h" |
| 16 | 17 |
| 17 struct addrinfo; | 18 struct addrinfo; |
| 18 | 19 |
| 19 namespace net { | 20 namespace net { |
| 20 | 21 |
| 21 class NET_EXPORT AddressList : private std::vector<IPEndPoint> { | 22 class NET_EXPORT AddressList |
| 23 : NON_EXPORTED_BASE(private std::vector<IPEndPoint>) { |
| 22 public: | 24 public: |
| 23 AddressList(); | 25 AddressList(); |
| 24 ~AddressList(); | 26 ~AddressList(); |
| 25 | 27 |
| 26 // Creates an address list for a single IP literal. | 28 // Creates an address list for a single IP literal. |
| 27 explicit AddressList(const IPEndPoint& endpoint); | 29 explicit AddressList(const IPEndPoint& endpoint); |
| 28 | 30 |
| 29 static AddressList CreateFromIPAddress(const IPAddressNumber& address, | 31 static AddressList CreateFromIPAddress(const IPAddressNumber& address, |
| 30 uint16 port); | 32 uint16 port); |
| 31 | 33 |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 // TODO(szym): Remove. http://crbug.com/126134 | 73 // TODO(szym): Remove. http://crbug.com/126134 |
| 72 std::string canonical_name_; | 74 std::string canonical_name_; |
| 73 }; | 75 }; |
| 74 | 76 |
| 75 // Sets the port on each element in |list| to |port|. | 77 // Sets the port on each element in |list| to |port|. |
| 76 void NET_EXPORT SetPortOnAddressList(uint16 port, AddressList* list); | 78 void NET_EXPORT SetPortOnAddressList(uint16 port, AddressList* list); |
| 77 | 79 |
| 78 } // namespace net | 80 } // namespace net |
| 79 | 81 |
| 80 #endif // NET_BASE_ADDRESS_LIST_H_ | 82 #endif // NET_BASE_ADDRESS_LIST_H_ |
| OLD | NEW |