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

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: Remove port 0 check 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
« no previous file with comments | « net/dns/dns_session_unittest.cc ('k') | net/dns/dns_socket_pool.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..973a9508a80588506c39eea607be4611aedf8999 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,12 @@ class NET_EXPORT_PRIVATE DnsSocketPool {
std::unique_ptr<DatagramClientSocket> CreateConnectedSocket(
unsigned server_index);
+ // Returns a random int in the specified range.
+ int GetRandomInt(int min, int max);
+
private:
ClientSocketFactory* socket_factory_;
+ const RandIntCallback& rand_int_callback_;
NetLog* net_log_;
const std::vector<IPEndPoint>* nameservers_;
bool initialized_;
« no previous file with comments | « net/dns/dns_session_unittest.cc ('k') | net/dns/dns_socket_pool.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698