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

Side by Side Diff: net/dns/address_sorter_win.cc

Issue 623213004: replace OVERRIDE and FINAL with override and final in net/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: undo unwanted change in comment Created 6 years, 2 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
« no previous file with comments | « net/dns/address_sorter_posix_unittest.cc ('k') | net/dns/dns_client.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 #include "net/dns/address_sorter.h" 5 #include "net/dns/address_sorter.h"
6 6
7 #include <winsock2.h> 7 #include <winsock2.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 10
(...skipping 13 matching lines...) Expand all
24 class AddressSorterWin : public AddressSorter { 24 class AddressSorterWin : public AddressSorter {
25 public: 25 public:
26 AddressSorterWin() { 26 AddressSorterWin() {
27 EnsureWinsockInit(); 27 EnsureWinsockInit();
28 } 28 }
29 29
30 virtual ~AddressSorterWin() {} 30 virtual ~AddressSorterWin() {}
31 31
32 // AddressSorter: 32 // AddressSorter:
33 virtual void Sort(const AddressList& list, 33 virtual void Sort(const AddressList& list,
34 const CallbackType& callback) const OVERRIDE { 34 const CallbackType& callback) const override {
35 DCHECK(!list.empty()); 35 DCHECK(!list.empty());
36 scoped_refptr<Job> job = new Job(list, callback); 36 scoped_refptr<Job> job = new Job(list, callback);
37 } 37 }
38 38
39 private: 39 private:
40 // Executes the SIO_ADDRESS_LIST_SORT ioctl on the WorkerPool, and 40 // Executes the SIO_ADDRESS_LIST_SORT ioctl on the WorkerPool, and
41 // performs the necessary conversions to/from AddressList. 41 // performs the necessary conversions to/from AddressList.
42 class Job : public base::RefCountedThreadSafe<Job> { 42 class Job : public base::RefCountedThreadSafe<Job> {
43 public: 43 public:
44 Job(const AddressList& list, const CallbackType& callback) 44 Job(const AddressList& list, const CallbackType& callback)
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 // Wrapper for AddressSorterWin which does not sort IPv4 or IPv4-mapped 153 // Wrapper for AddressSorterWin which does not sort IPv4 or IPv4-mapped
154 // addresses but always puts them at the end of the list. Needed because the 154 // addresses but always puts them at the end of the list. Needed because the
155 // SIO_ADDRESS_LIST_SORT does not support IPv4 addresses on Windows XP. 155 // SIO_ADDRESS_LIST_SORT does not support IPv4 addresses on Windows XP.
156 class AddressSorterWinXP : public AddressSorter { 156 class AddressSorterWinXP : public AddressSorter {
157 public: 157 public:
158 AddressSorterWinXP() {} 158 AddressSorterWinXP() {}
159 virtual ~AddressSorterWinXP() {} 159 virtual ~AddressSorterWinXP() {}
160 160
161 // AddressSorter: 161 // AddressSorter:
162 virtual void Sort(const AddressList& list, 162 virtual void Sort(const AddressList& list,
163 const CallbackType& callback) const OVERRIDE { 163 const CallbackType& callback) const override {
164 AddressList list_ipv4; 164 AddressList list_ipv4;
165 AddressList list_ipv6; 165 AddressList list_ipv6;
166 for (size_t i = 0; i < list.size(); ++i) { 166 for (size_t i = 0; i < list.size(); ++i) {
167 const IPEndPoint& ipe = list[i]; 167 const IPEndPoint& ipe = list[i];
168 if (ipe.GetFamily() == ADDRESS_FAMILY_IPV4) { 168 if (ipe.GetFamily() == ADDRESS_FAMILY_IPV4) {
169 list_ipv4.push_back(ipe); 169 list_ipv4.push_back(ipe);
170 } else { 170 } else {
171 list_ipv6.push_back(ipe); 171 list_ipv6.push_back(ipe);
172 } 172 }
173 } 173 }
(...skipping 15 matching lines...) Expand all
189 189
190 // static 190 // static
191 scoped_ptr<AddressSorter> AddressSorter::CreateAddressSorter() { 191 scoped_ptr<AddressSorter> AddressSorter::CreateAddressSorter() {
192 if (base::win::GetVersion() < base::win::VERSION_VISTA) 192 if (base::win::GetVersion() < base::win::VERSION_VISTA)
193 return scoped_ptr<AddressSorter>(new AddressSorterWinXP()); 193 return scoped_ptr<AddressSorter>(new AddressSorterWinXP());
194 return scoped_ptr<AddressSorter>(new AddressSorterWin()); 194 return scoped_ptr<AddressSorter>(new AddressSorterWin());
195 } 195 }
196 196
197 } // namespace net 197 } // namespace net
198 198
OLDNEW
« no previous file with comments | « net/dns/address_sorter_posix_unittest.cc ('k') | net/dns/dns_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698