| 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 #include "net/base/address_list.h" | 5 #include "net/base/address_list.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 DLOG(WARNING) << "Unknown family found in addrinfo: " << ai->ai_family; | 81 DLOG(WARNING) << "Unknown family found in addrinfo: " << ai->ai_family; |
| 82 } | 82 } |
| 83 return list; | 83 return list; |
| 84 } | 84 } |
| 85 | 85 |
| 86 // static | 86 // static |
| 87 AddressList AddressList::CopyWithPort(const AddressList& list, uint16_t port) { | 87 AddressList AddressList::CopyWithPort(const AddressList& list, uint16_t port) { |
| 88 AddressList out; | 88 AddressList out; |
| 89 out.set_canonical_name(list.canonical_name()); | 89 out.set_canonical_name(list.canonical_name()); |
| 90 for (size_t i = 0; i < list.size(); ++i) | 90 for (size_t i = 0; i < list.size(); ++i) |
| 91 out.push_back(IPEndPoint(list[i].address(), port)); | 91 out.push_back(IPEndPoint(list[i].address_number(), port)); |
| 92 return out; | 92 return out; |
| 93 } | 93 } |
| 94 | 94 |
| 95 void AddressList::SetDefaultCanonicalName() { | 95 void AddressList::SetDefaultCanonicalName() { |
| 96 DCHECK(!empty()); | 96 DCHECK(!empty()); |
| 97 set_canonical_name(front().ToStringWithoutPort()); | 97 set_canonical_name(front().ToStringWithoutPort()); |
| 98 } | 98 } |
| 99 | 99 |
| 100 NetLog::ParametersCallback AddressList::CreateNetLogCallback() const { | 100 NetLog::ParametersCallback AddressList::CreateNetLogCallback() const { |
| 101 return base::Bind(&NetLogAddressListCallback, this); | 101 return base::Bind(&NetLogAddressListCallback, this); |
| 102 } | 102 } |
| 103 | 103 |
| 104 } // namespace net | 104 } // namespace net |
| OLD | NEW |