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_SOCKET_FUZZED_SOCKET_FACTORY_H_ | 5 #ifndef NET_SOCKET_FUZZED_SOCKET_FACTORY_H_ |
6 #define NET_SOCKET_FUZZED_SOCKET_FACTORY_H_ | 6 #define NET_SOCKET_FUZZED_SOCKET_FACTORY_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 const NetLogSource& source) override; | 48 const NetLogSource& source) override; |
49 | 49 |
50 std::unique_ptr<SSLClientSocket> CreateSSLClientSocket( | 50 std::unique_ptr<SSLClientSocket> CreateSSLClientSocket( |
51 std::unique_ptr<ClientSocketHandle> transport_socket, | 51 std::unique_ptr<ClientSocketHandle> transport_socket, |
52 const HostPortPair& host_and_port, | 52 const HostPortPair& host_and_port, |
53 const SSLConfig& ssl_config, | 53 const SSLConfig& ssl_config, |
54 const SSLClientSocketContext& context) override; | 54 const SSLClientSocketContext& context) override; |
55 | 55 |
56 void ClearSSLSessionCache() override; | 56 void ClearSSLSessionCache() override; |
57 | 57 |
| 58 // Sets whether Connect()ions on returned sockets can be asynchronously |
| 59 // delayed or outright fail. Defaults to true. |
| 60 void set_fuzz_connect_result(bool v) { fuzz_connect_result_ = v; } |
| 61 |
58 private: | 62 private: |
59 base::FuzzedDataProvider* data_provider_; | 63 base::FuzzedDataProvider* data_provider_; |
| 64 bool fuzz_connect_result_; |
60 | 65 |
61 DISALLOW_COPY_AND_ASSIGN(FuzzedSocketFactory); | 66 DISALLOW_COPY_AND_ASSIGN(FuzzedSocketFactory); |
62 }; | 67 }; |
63 | 68 |
64 } // namespace net | 69 } // namespace net |
65 | 70 |
66 #endif // NET_SOCKET_FUZZED_SOCKET_FACTORY_H_ | 71 #endif // NET_SOCKET_FUZZED_SOCKET_FACTORY_H_ |
OLD | NEW |