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

Unified Diff: net/dns/address_sorter_win.cc

Issue 1945583002: [NET] Del: Remove AddressSorterWinXP wrapper for AddressSorterWin (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove not used function Created 4 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | net/socket/tcp_socket_win.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/dns/address_sorter_win.cc
diff --git a/net/dns/address_sorter_win.cc b/net/dns/address_sorter_win.cc
index fb5f087629a9ffcf055911f0bbaf6fce25523fb4..f76c1ccc586fb24241076f360e2508836809af1b 100644
--- a/net/dns/address_sorter_win.cc
+++ b/net/dns/address_sorter_win.cc
@@ -140,63 +140,10 @@ class AddressSorterWin : public AddressSorter {
DISALLOW_COPY_AND_ASSIGN(AddressSorterWin);
};
-// Merges |list_ipv4| and |list_ipv6| before passing it to |callback|, but
-// only if |success| is true.
-void MergeResults(const AddressSorter::CallbackType& callback,
- const AddressList& list_ipv4,
- bool success,
- const AddressList& list_ipv6) {
- if (!success) {
- callback.Run(false, AddressList());
- return;
- }
- AddressList list;
- list.insert(list.end(), list_ipv6.begin(), list_ipv6.end());
- list.insert(list.end(), list_ipv4.begin(), list_ipv4.end());
- callback.Run(true, list);
-}
-
-// Wrapper for AddressSorterWin which does not sort IPv4 or IPv4-mapped
-// addresses but always puts them at the end of the list. Needed because the
-// SIO_ADDRESS_LIST_SORT does not support IPv4 addresses on Windows XP.
-class AddressSorterWinXP : public AddressSorter {
- public:
- AddressSorterWinXP() {}
- ~AddressSorterWinXP() override {}
-
- // AddressSorter:
- void Sort(const AddressList& list,
- const CallbackType& callback) const override {
- AddressList list_ipv4;
- AddressList list_ipv6;
- for (size_t i = 0; i < list.size(); ++i) {
- const IPEndPoint& ipe = list[i];
- if (ipe.GetFamily() == ADDRESS_FAMILY_IPV4) {
- list_ipv4.push_back(ipe);
- } else {
- list_ipv6.push_back(ipe);
- }
- }
- if (!list_ipv6.empty()) {
- sorter_.Sort(list_ipv6, base::Bind(&MergeResults, callback, list_ipv4));
- } else {
- NOTREACHED() << "Should not be called with IPv4-only addresses.";
- callback.Run(true, list);
- }
- }
-
- private:
- AddressSorterWin sorter_;
-
- DISALLOW_COPY_AND_ASSIGN(AddressSorterWinXP);
-};
-
} // namespace
// static
std::unique_ptr<AddressSorter> AddressSorter::CreateAddressSorter() {
- if (base::win::GetVersion() < base::win::VERSION_VISTA)
- return std::unique_ptr<AddressSorter>(new AddressSorterWinXP());
return std::unique_ptr<AddressSorter>(new AddressSorterWin());
}
« no previous file with comments | « no previous file | net/socket/tcp_socket_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698