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