Index: net/dns/dns_socket_pool.h |
diff --git a/net/dns/dns_socket_pool.h b/net/dns/dns_socket_pool.h |
index 1e88a87691e878ce2402d40e316ce0f493bd5ddc..04bbf145f438539547c910b8674b267b53735717 100644 |
--- a/net/dns/dns_socket_pool.h |
+++ b/net/dns/dns_socket_pool.h |
@@ -10,6 +10,7 @@ |
#include "base/macros.h" |
#include "net/base/net_export.h" |
+#include "net/base/rand_callback.h" |
#include "net/log/net_log.h" |
namespace net { |
@@ -31,13 +32,15 @@ class NET_EXPORT_PRIVATE DnsSocketPool { |
// sockets. (This varies by platform; see DnsSocketPoolImpl in |
// dns_socket_pool.cc for details.) |
static std::unique_ptr<DnsSocketPool> CreateDefault( |
- ClientSocketFactory* factory); |
+ ClientSocketFactory* factory, |
+ const RandIntCallback& rand_int_callback); |
// Creates a DnsSocketPool that implements a "null" strategy -- no sockets are |
// preallocated, allocation requests are satisfied by calling the factory |
// directly, and returned sockets are deleted immediately. |
static std::unique_ptr<DnsSocketPool> CreateNull( |
- ClientSocketFactory* factory); |
+ ClientSocketFactory* factory, |
+ const RandIntCallback& rand_int_callback); |
// Initializes the DnsSocketPool. |nameservers| is the list of nameservers |
// for which the DnsSocketPool will manage sockets; |net_log| is the NetLog |
@@ -67,7 +70,8 @@ class NET_EXPORT_PRIVATE DnsSocketPool { |
const NetLog::Source& source); |
protected: |
- DnsSocketPool(ClientSocketFactory* socket_factory); |
+ DnsSocketPool(ClientSocketFactory* socket_factory, |
+ const RandIntCallback& rand_int_callback); |
void InitializeInternal( |
const std::vector<IPEndPoint>* nameservers, |
@@ -76,8 +80,13 @@ class NET_EXPORT_PRIVATE DnsSocketPool { |
std::unique_ptr<DatagramClientSocket> CreateConnectedSocket( |
unsigned server_index); |
+ const RandIntCallback& rand_int_callback() const { |
+ return rand_int_callback_; |
+ } |
+ |
private: |
ClientSocketFactory* socket_factory_; |
+ const RandIntCallback& rand_int_callback_; |
NetLog* net_log_; |
const std::vector<IPEndPoint>* nameservers_; |
bool initialized_; |