| 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 #include "net/socket/fuzzed_socket_factory.h" | 5 #include "net/socket/fuzzed_socket_factory.h" |
| 6 | 6 |
| 7 #include "base/fuzzed_data_provider.h" |
| 7 #include "base/logging.h" | 8 #include "base/logging.h" |
| 8 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
| 9 #include "net/base/address_list.h" | 10 #include "net/base/address_list.h" |
| 10 #include "net/base/ip_endpoint.h" | 11 #include "net/base/ip_endpoint.h" |
| 11 #include "net/base/net_errors.h" | 12 #include "net/base/net_errors.h" |
| 12 #include "net/base/network_change_notifier.h" | 13 #include "net/base/network_change_notifier.h" |
| 13 #include "net/log/net_log.h" | 14 #include "net/log/net_log.h" |
| 14 #include "net/socket/client_socket_handle.h" | 15 #include "net/socket/client_socket_handle.h" |
| 15 #include "net/socket/connection_attempts.h" | 16 #include "net/socket/connection_attempts.h" |
| 16 #include "net/socket/fuzzed_socket.h" | 17 #include "net/socket/fuzzed_socket.h" |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 } | 117 } |
| 117 | 118 |
| 118 private: | 119 private: |
| 119 BoundNetLog net_log_; | 120 BoundNetLog net_log_; |
| 120 | 121 |
| 121 DISALLOW_COPY_AND_ASSIGN(FailingSSLClientSocket); | 122 DISALLOW_COPY_AND_ASSIGN(FailingSSLClientSocket); |
| 122 }; | 123 }; |
| 123 | 124 |
| 124 } // namespace | 125 } // namespace |
| 125 | 126 |
| 126 FuzzedSocketFactory::FuzzedSocketFactory(FuzzedDataProvider* data_provider) | 127 FuzzedSocketFactory::FuzzedSocketFactory( |
| 128 base::FuzzedDataProvider* data_provider) |
| 127 : data_provider_(data_provider) {} | 129 : data_provider_(data_provider) {} |
| 128 | 130 |
| 129 FuzzedSocketFactory::~FuzzedSocketFactory() {} | 131 FuzzedSocketFactory::~FuzzedSocketFactory() {} |
| 130 | 132 |
| 131 std::unique_ptr<DatagramClientSocket> | 133 std::unique_ptr<DatagramClientSocket> |
| 132 FuzzedSocketFactory::CreateDatagramClientSocket( | 134 FuzzedSocketFactory::CreateDatagramClientSocket( |
| 133 DatagramSocket::BindType bind_type, | 135 DatagramSocket::BindType bind_type, |
| 134 const RandIntCallback& rand_int_cb, | 136 const RandIntCallback& rand_int_cb, |
| 135 NetLog* net_log, | 137 NetLog* net_log, |
| 136 const NetLog::Source& source) { | 138 const NetLog::Source& source) { |
| (...skipping 17 matching lines...) Expand all Loading... |
| 154 std::unique_ptr<ClientSocketHandle> transport_socket, | 156 std::unique_ptr<ClientSocketHandle> transport_socket, |
| 155 const HostPortPair& host_and_port, | 157 const HostPortPair& host_and_port, |
| 156 const SSLConfig& ssl_config, | 158 const SSLConfig& ssl_config, |
| 157 const SSLClientSocketContext& context) { | 159 const SSLClientSocketContext& context) { |
| 158 return base::WrapUnique(new FailingSSLClientSocket()); | 160 return base::WrapUnique(new FailingSSLClientSocket()); |
| 159 } | 161 } |
| 160 | 162 |
| 161 void FuzzedSocketFactory::ClearSSLSessionCache() {} | 163 void FuzzedSocketFactory::ClearSSLSessionCache() {} |
| 162 | 164 |
| 163 } // namespace net | 165 } // namespace net |
| OLD | NEW |