OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_FUZZED_HOST_RESOLVER_ | 5 #ifndef NET_DNS_FUZZED_HOST_RESOLVER_ |
6 #define NET_DNS_FUZZED_HOST_RESOLVER_ | 6 #define NET_DNS_FUZZED_HOST_RESOLVER_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 base::FuzzedDataProvider* data_provider); | 53 base::FuzzedDataProvider* data_provider); |
54 ~FuzzedHostResolver() override; | 54 ~FuzzedHostResolver() override; |
55 | 55 |
56 // Enable / disable the async resolver. When enabled, installs a | 56 // Enable / disable the async resolver. When enabled, installs a |
57 // DnsClient with fuzzed UDP and TCP sockets. Overrides | 57 // DnsClient with fuzzed UDP and TCP sockets. Overrides |
58 // HostResolverImpl method of the same name. | 58 // HostResolverImpl method of the same name. |
59 void SetDnsClientEnabled(bool enabled) override; | 59 void SetDnsClientEnabled(bool enabled) override; |
60 | 60 |
61 private: | 61 private: |
62 // HostResolverImpl implementation: | 62 // HostResolverImpl implementation: |
63 bool IsIPv6Reachable(const BoundNetLog& net_log) override; | 63 bool IsIPv6Reachable(const NetLogWithSource& net_log) override; |
64 void RunLoopbackProbeJob() override; | 64 void RunLoopbackProbeJob() override; |
65 | 65 |
66 base::FuzzedDataProvider* data_provider_; | 66 base::FuzzedDataProvider* data_provider_; |
67 | 67 |
68 // Used for UDP and TCP sockets if the async resolver is enabled. | 68 // Used for UDP and TCP sockets if the async resolver is enabled. |
69 FuzzedSocketFactory socket_factory_; | 69 FuzzedSocketFactory socket_factory_; |
70 | 70 |
71 // Fixed value to be returned by IsIPv6Reachable. | 71 // Fixed value to be returned by IsIPv6Reachable. |
72 const bool is_ipv6_reachable_; | 72 const bool is_ipv6_reachable_; |
73 | 73 |
74 NetLog* net_log_; | 74 NetLog* net_log_; |
75 | 75 |
76 base::WeakPtrFactory<base::FuzzedDataProvider> data_provider_weak_factory_; | 76 base::WeakPtrFactory<base::FuzzedDataProvider> data_provider_weak_factory_; |
77 | 77 |
78 DISALLOW_COPY_AND_ASSIGN(FuzzedHostResolver); | 78 DISALLOW_COPY_AND_ASSIGN(FuzzedHostResolver); |
79 }; | 79 }; |
80 | 80 |
81 } // namespace net | 81 } // namespace net |
82 | 82 |
83 #endif // NET_DNS_FUZZED_HOST_RESOLVER_ | 83 #endif // NET_DNS_FUZZED_HOST_RESOLVER_ |
OLD | NEW |