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