| 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_H_ | 5 #ifndef NET_SOCKET_FUZZED_SOCKET_H_ |
| 6 #define NET_SOCKET_FUZZED_SOCKET_H_ | 6 #define NET_SOCKET_FUZZED_SOCKET_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 void SetOmniboxSpeculation() override; | 79 void SetOmniboxSpeculation() override; |
| 80 bool WasEverUsed() const override; | 80 bool WasEverUsed() const override; |
| 81 void EnableTCPFastOpenIfSupported() override; | 81 void EnableTCPFastOpenIfSupported() override; |
| 82 bool WasNpnNegotiated() const override; | 82 bool WasNpnNegotiated() const override; |
| 83 NextProto GetNegotiatedProtocol() const override; | 83 NextProto GetNegotiatedProtocol() const override; |
| 84 bool GetSSLInfo(SSLInfo* ssl_info) override; | 84 bool GetSSLInfo(SSLInfo* ssl_info) override; |
| 85 void GetConnectionAttempts(ConnectionAttempts* out) const override; | 85 void GetConnectionAttempts(ConnectionAttempts* out) const override; |
| 86 void ClearConnectionAttempts() override; | 86 void ClearConnectionAttempts() override; |
| 87 void AddConnectionAttempts(const ConnectionAttempts& attempts) override; | 87 void AddConnectionAttempts(const ConnectionAttempts& attempts) override; |
| 88 int64_t GetTotalReceivedBytes() const override; | 88 int64_t GetTotalReceivedBytes() const override; |
| 89 void DumpMemoryStats( |
| 90 base::trace_event::MemoryAllocatorDump* dump) const override; |
| 89 | 91 |
| 90 private: | 92 private: |
| 91 // Returns a net::Error that can be returned by a read or a write. Reads and | 93 // Returns a net::Error that can be returned by a read or a write. Reads and |
| 92 // writes return basically the same set of errors, at the TCP socket layer. | 94 // writes return basically the same set of errors, at the TCP socket layer. |
| 93 Error ConsumeReadWriteErrorFromData(); | 95 Error ConsumeReadWriteErrorFromData(); |
| 94 | 96 |
| 95 void OnReadComplete(const CompletionCallback& callback, int result); | 97 void OnReadComplete(const CompletionCallback& callback, int result); |
| 96 void OnWriteComplete(const CompletionCallback& callback, int result); | 98 void OnWriteComplete(const CompletionCallback& callback, int result); |
| 97 void OnConnectComplete(const CompletionCallback& callback, int result); | 99 void OnConnectComplete(const CompletionCallback& callback, int result); |
| 98 | 100 |
| (...skipping 25 matching lines...) Expand all Loading... |
| 124 IPEndPoint remote_address_; | 126 IPEndPoint remote_address_; |
| 125 | 127 |
| 126 base::WeakPtrFactory<FuzzedSocket> weak_factory_; | 128 base::WeakPtrFactory<FuzzedSocket> weak_factory_; |
| 127 | 129 |
| 128 DISALLOW_COPY_AND_ASSIGN(FuzzedSocket); | 130 DISALLOW_COPY_AND_ASSIGN(FuzzedSocket); |
| 129 }; | 131 }; |
| 130 | 132 |
| 131 } // namespace net | 133 } // namespace net |
| 132 | 134 |
| 133 #endif // NET_SOCKET_FUZZED_SOCKET_H_ | 135 #endif // NET_SOCKET_FUZZED_SOCKET_H_ |
| OLD | NEW |