| 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/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 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 ipe.port()); | 117 ipe.port()); |
| 118 } | 118 } |
| 119 list.push_back(ipe); | 119 list.push_back(ipe); |
| 120 } | 120 } |
| 121 } | 121 } |
| 122 callback_.Run(success_, list); | 122 callback_.Run(success_, list); |
| 123 } | 123 } |
| 124 | 124 |
| 125 const CallbackType callback_; | 125 const CallbackType callback_; |
| 126 const size_t buffer_size_; | 126 const size_t buffer_size_; |
| 127 scoped_ptr_malloc<SOCKET_ADDRESS_LIST> input_buffer_; | 127 scoped_ptr<SOCKET_ADDRESS_LIST, base::FreeDeleter> input_buffer_; |
| 128 scoped_ptr_malloc<SOCKET_ADDRESS_LIST> output_buffer_; | 128 scoped_ptr<SOCKET_ADDRESS_LIST, base::FreeDeleter> output_buffer_; |
| 129 bool success_; | 129 bool success_; |
| 130 | 130 |
| 131 DISALLOW_COPY_AND_ASSIGN(Job); | 131 DISALLOW_COPY_AND_ASSIGN(Job); |
| 132 }; | 132 }; |
| 133 | 133 |
| 134 DISALLOW_COPY_AND_ASSIGN(AddressSorterWin); | 134 DISALLOW_COPY_AND_ASSIGN(AddressSorterWin); |
| 135 }; | 135 }; |
| 136 | 136 |
| 137 // Merges |list_ipv4| and |list_ipv6| before passing it to |callback|, but | 137 // Merges |list_ipv4| and |list_ipv6| before passing it to |callback|, but |
| 138 // only if |success| is true. | 138 // only if |success| is true. |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 |
| OLD | NEW |