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 #ifndef NET_DNS_DNS_SESSION_H_ | 5 #ifndef NET_DNS_DNS_SESSION_H_ |
6 #define NET_DNS_DNS_SESSION_H_ | 6 #define NET_DNS_DNS_SESSION_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 | 58 |
59 DnsSession(const DnsConfig& config, | 59 DnsSession(const DnsConfig& config, |
60 scoped_ptr<DnsSocketPool> socket_pool, | 60 scoped_ptr<DnsSocketPool> socket_pool, |
61 const RandIntCallback& rand_int_callback, | 61 const RandIntCallback& rand_int_callback, |
62 NetLog* net_log); | 62 NetLog* net_log); |
63 | 63 |
64 const DnsConfig& config() const { return config_; } | 64 const DnsConfig& config() const { return config_; } |
65 NetLog* net_log() const { return net_log_; } | 65 NetLog* net_log() const { return net_log_; } |
66 | 66 |
67 // Return the next random query ID. | 67 // Return the next random query ID. |
68 uint16_t NextQueryId() const; | 68 uint16 NextQueryId() const; |
69 | 69 |
70 // Return the index of the first configured server to use on first attempt. | 70 // Return the index of the first configured server to use on first attempt. |
71 unsigned NextFirstServerIndex(); | 71 unsigned NextFirstServerIndex(); |
72 | 72 |
73 // Start with |server_index| and find the index of the next known good server | 73 // Start with |server_index| and find the index of the next known good server |
74 // to use on this attempt. Returns |server_index| if this server has no | 74 // to use on this attempt. Returns |server_index| if this server has no |
75 // recorded failures, or if there are no other servers that have not failed | 75 // recorded failures, or if there are no other servers that have not failed |
76 // or have failed longer time ago. | 76 // or have failed longer time ago. |
77 unsigned NextGoodServerIndex(unsigned server_index); | 77 unsigned NextGoodServerIndex(unsigned server_index); |
78 | 78 |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 RttBuckets(); | 137 RttBuckets(); |
138 }; | 138 }; |
139 static base::LazyInstance<RttBuckets>::Leaky rtt_buckets_; | 139 static base::LazyInstance<RttBuckets>::Leaky rtt_buckets_; |
140 | 140 |
141 DISALLOW_COPY_AND_ASSIGN(DnsSession); | 141 DISALLOW_COPY_AND_ASSIGN(DnsSession); |
142 }; | 142 }; |
143 | 143 |
144 } // namespace net | 144 } // namespace net |
145 | 145 |
146 #endif // NET_DNS_DNS_SESSION_H_ | 146 #endif // NET_DNS_DNS_SESSION_H_ |
OLD | NEW |