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

Side by Side Diff: net/base/address_list.cc

Issue 1565303002: Change IPEndpoint::address() to return a net::IPAddress (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Feedback eroman Created 4 years, 11 months 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 #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
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().bytes(), 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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698