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

Unified Diff: net/dns/dns_client.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_client.h
diff --git a/net/dns/dns_client.h b/net/dns/dns_client.h
index 01d024b9a17032b18d51c57177e74ae478f1177a..bb63aaa541190a1a298302ab2944ec3aaa7e5007 100644
--- a/net/dns/dns_client.h
+++ b/net/dns/dns_client.h
@@ -8,10 +8,12 @@
#include <memory>
#include "net/base/net_export.h"
+#include "net/base/rand_callback.h"
namespace net {
class AddressSorter;
+class ClientSocketFactory;
struct DnsConfig;
class DnsTransactionFactory;
class NetLog;
@@ -38,6 +40,14 @@ class NET_EXPORT DnsClient {
// Creates default client.
static std::unique_ptr<DnsClient> CreateClient(NetLog* net_log);
+
+ // Creates a client for testing. Allows using a mock ClientSocketFactory and
+ // a deterministic random number generator. |socket_factory| must outlive
+ // the returned DnsClient.
+ static std::unique_ptr<DnsClient> CreateClientForTesting(
+ NetLog* net_log,
+ ClientSocketFactory* socket_factory,
+ const RandIntCallback& rand_int_callback);
};
} // namespace net

Powered by Google App Engine
This is Rietveld 408576698