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

Side by Side Diff: net/socket/fuzzed_socket_factory.h

Issue 1917503002: URLRequest fuzzer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@fuzz
Patch Set: Update other fuzzers (Lost them in a merge) Created 4 years, 8 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 unified diff | Download patch
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef NET_SOCKET_FUZZED_SOCKET_FACTORY_H
6 #define NET_SOCKET_FUZZED_SOCKET_FACTORY_H
7
8 #include <memory>
9
10 #include "base/macros.h"
11 #include "net/socket/client_socket_factory.h"
12
13 namespace net {
14
15 class FuzzedDataProvider;
16
17 // A socket factory that creates FuzzedSockets that share the same
18 // FuzzedDataProvider. To behave consistently, the read operations on all
19 // sockets much bet the same, and in the same order (both on each socket, and
eroman 2016/04/22 22:07:11 much bet, aye? :)
mmenke 2016/04/27 19:53:25 Yes, yes. Much bet, very much bet.
20 // between sockets).
21 //
22 // Currently doesn't support UDP or SSL sockets - just returns sockets that
23 // synchronously fail to connect when trying to create either type of socket.
24 // TODO(mmenke): Add support for both types of socket.
eroman 2016/04/22 22:07:11 Also TODO: add fuzzing for generation of valid cry
mmenke 2016/04/27 19:53:25 Done.
25 class FuzzedSocketFactory : public ClientSocketFactory {
26 public:
27 explicit FuzzedSocketFactory(FuzzedDataProvider* data_provider);
eroman 2016/04/22 22:07:11 mention ownership. I assume non-owned when we don
mmenke 2016/04/27 19:53:25 Done.
28 ~FuzzedSocketFactory() override;
29
30 std::unique_ptr<DatagramClientSocket> CreateDatagramClientSocket(
31 DatagramSocket::BindType bind_type,
32 const RandIntCallback& rand_int_cb,
33 NetLog* net_log,
34 const NetLog::Source& source) override;
35
36 std::unique_ptr<StreamSocket> CreateTransportClientSocket(
37 const AddressList& addresses,
38 std::unique_ptr<SocketPerformanceWatcher> socket_performance_watcher,
39 NetLog* net_log,
40 const NetLog::Source& source) override;
41
42 std::unique_ptr<SSLClientSocket> CreateSSLClientSocket(
43 std::unique_ptr<ClientSocketHandle> transport_socket,
44 const HostPortPair& host_and_port,
45 const SSLConfig& ssl_config,
46 const SSLClientSocketContext& context) override;
47
48 void ClearSSLSessionCache() override;
49
50 private:
51 FuzzedDataProvider* data_provider_;
52
53 DISALLOW_COPY_AND_ASSIGN(FuzzedSocketFactory);
54 };
55
56 } // namespace net
57
58 #endif // NET_SOCKET_FUZZED_SOCKET_FACTORY_H
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698