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

Side by Side Diff: net/dns/address_sorter.h

Issue 10855179: [net/dns] Resolve AF_UNSPEC on dual-stacked systems. Sort addresses according to RFC3484. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sync Created 8 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « net/base/net_util_unittest.cc ('k') | net/dns/address_sorter_posix.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef NET_DNS_ADDRESS_SORTER_H_
6 #define NET_DNS_ADDRESS_SORTER_H_
7
8 #include "base/basictypes.h"
9 #include "base/callback.h"
10 #include "base/memory/scoped_ptr.h"
11 #include "net/base/net_export.h"
12
13 namespace net {
14
15 class AddressList;
16
17 // Sorts AddressList according to RFC3484, by likelihood of successful
18 // connection. Depending on the platform, the sort could be performed
19 // asynchronously by the OS, or synchronously by local implementation.
20 // AddressSorter does not necessarily preserve port numbers on the sorted list.
21 class NET_EXPORT AddressSorter {
22 public:
23 typedef base::Callback<void(bool success,
24 const AddressList& list)> CallbackType;
25
26 virtual ~AddressSorter() {}
27
28 // Sorts |list|, which must include at least one IPv6 address.
29 // Calls |callback| upon completion. Could complete synchronously. Could
30 // complete after this AddressSorter is destroyed.
31 virtual void Sort(const AddressList& list,
32 const CallbackType& callback) const = 0;
33
34 // Creates platform-dependent AddressSorter.
35 static scoped_ptr<AddressSorter> CreateAddressSorter();
36
37 protected:
38 AddressSorter() {}
39
40 private:
41 DISALLOW_COPY_AND_ASSIGN(AddressSorter);
42 };
43
44 } // namespace net
45
46 #endif // NET_DNS_ADDRESS_SORTER_H_
OLDNEW
« no previous file with comments | « net/base/net_util_unittest.cc ('k') | net/dns/address_sorter_posix.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698