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_UDP_FUZZED_DATAGRAM_CLIENT_SOCKET_H_ | 5 #ifndef NET_UDP_FUZZED_DATAGRAM_CLIENT_SOCKET_H_ |
6 #define NET_UDP_FUZZED_DATAGRAM_CLIENT_SOCKET_H_ | 6 #define NET_UDP_FUZZED_DATAGRAM_CLIENT_SOCKET_H_ |
7 | 7 |
8 #include "net/udp/datagram_client_socket.h" | 8 #include "net/udp/datagram_client_socket.h" |
9 | 9 |
10 #include <stdint.h> | 10 #include <stdint.h> |
(...skipping 26 matching lines...) Expand all Loading... |
37 int ConnectUsingNetwork(NetworkChangeNotifier::NetworkHandle network, | 37 int ConnectUsingNetwork(NetworkChangeNotifier::NetworkHandle network, |
38 const IPEndPoint& address) override; | 38 const IPEndPoint& address) override; |
39 int ConnectUsingDefaultNetwork(const IPEndPoint& address) override; | 39 int ConnectUsingDefaultNetwork(const IPEndPoint& address) override; |
40 NetworkChangeNotifier::NetworkHandle GetBoundNetwork() const override; | 40 NetworkChangeNotifier::NetworkHandle GetBoundNetwork() const override; |
41 | 41 |
42 // DatagramSocket implementation: | 42 // DatagramSocket implementation: |
43 void Close() override; | 43 void Close() override; |
44 int GetPeerAddress(IPEndPoint* address) const override; | 44 int GetPeerAddress(IPEndPoint* address) const override; |
45 int GetLocalAddress(IPEndPoint* address) const override; | 45 int GetLocalAddress(IPEndPoint* address) const override; |
46 void UseNonBlockingIO() override; | 46 void UseNonBlockingIO() override; |
47 const BoundNetLog& NetLog() const override; | 47 const NetLogWithSource& NetLog() const override; |
48 | 48 |
49 // Socket implementation: | 49 // Socket implementation: |
50 int Read(IOBuffer* buf, | 50 int Read(IOBuffer* buf, |
51 int buf_len, | 51 int buf_len, |
52 const CompletionCallback& callback) override; | 52 const CompletionCallback& callback) override; |
53 int Write(IOBuffer* buf, | 53 int Write(IOBuffer* buf, |
54 int buf_len, | 54 int buf_len, |
55 const CompletionCallback& callback) override; | 55 const CompletionCallback& callback) override; |
56 int SetReceiveBufferSize(int32_t size) override; | 56 int SetReceiveBufferSize(int32_t size) override; |
57 int SetSendBufferSize(int32_t size) override; | 57 int SetSendBufferSize(int32_t size) override; |
58 int SetDoNotFragment() override; | 58 int SetDoNotFragment() override; |
59 | 59 |
60 private: | 60 private: |
61 void OnReadComplete(const net::CompletionCallback& callback, int result); | 61 void OnReadComplete(const net::CompletionCallback& callback, int result); |
62 void OnWriteComplete(const net::CompletionCallback& callback, int result); | 62 void OnWriteComplete(const net::CompletionCallback& callback, int result); |
63 | 63 |
64 base::FuzzedDataProvider* data_provider_; | 64 base::FuzzedDataProvider* data_provider_; |
65 | 65 |
66 bool connected_ = false; | 66 bool connected_ = false; |
67 bool read_pending_ = false; | 67 bool read_pending_ = false; |
68 bool write_pending_ = false; | 68 bool write_pending_ = false; |
69 | 69 |
70 BoundNetLog net_log_; | 70 NetLogWithSource net_log_; |
71 | 71 |
72 IPEndPoint remote_address_; | 72 IPEndPoint remote_address_; |
73 | 73 |
74 base::WeakPtrFactory<FuzzedDatagramClientSocket> weak_factory_; | 74 base::WeakPtrFactory<FuzzedDatagramClientSocket> weak_factory_; |
75 | 75 |
76 DISALLOW_COPY_AND_ASSIGN(FuzzedDatagramClientSocket); | 76 DISALLOW_COPY_AND_ASSIGN(FuzzedDatagramClientSocket); |
77 }; | 77 }; |
78 | 78 |
79 } // namespace net | 79 } // namespace net |
80 | 80 |
81 #endif // NET_UDP_FUZZED_DATAGRAM_CLIENT_SOCKET_H_ | 81 #endif // NET_UDP_FUZZED_DATAGRAM_CLIENT_SOCKET_H_ |
OLD | NEW |