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

Unified Diff: net/dns/dns_socket_pool.h

Issue 1946793002: net: Add fuzzer for HostResolverImpl. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: merge, fix build Created 4 years, 7 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
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_;

Powered by Google App Engine
This is Rietveld 408576698