| 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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 int SetReceiveBufferSize(int32_t size) override; | 66 int SetReceiveBufferSize(int32_t size) override; |
| 67 int SetSendBufferSize(int32_t size) override; | 67 int SetSendBufferSize(int32_t size) override; |
| 68 | 68 |
| 69 // StreamSocket implementation: | 69 // StreamSocket implementation: |
| 70 int Connect(const CompletionCallback& callback) override; | 70 int Connect(const CompletionCallback& callback) override; |
| 71 void Disconnect() override; | 71 void Disconnect() override; |
| 72 bool IsConnected() const override; | 72 bool IsConnected() const override; |
| 73 bool IsConnectedAndIdle() const override; | 73 bool IsConnectedAndIdle() const override; |
| 74 int GetPeerAddress(IPEndPoint* address) const override; | 74 int GetPeerAddress(IPEndPoint* address) const override; |
| 75 int GetLocalAddress(IPEndPoint* address) const override; | 75 int GetLocalAddress(IPEndPoint* address) const override; |
| 76 const BoundNetLog& NetLog() const override; | 76 const NetLogWithSource& NetLog() const override; |
| 77 void SetSubresourceSpeculation() override; | 77 void SetSubresourceSpeculation() override; |
| 78 void SetOmniboxSpeculation() override; | 78 void SetOmniboxSpeculation() override; |
| 79 bool WasEverUsed() const override; | 79 bool WasEverUsed() const override; |
| 80 void EnableTCPFastOpenIfSupported() override; | 80 void EnableTCPFastOpenIfSupported() override; |
| 81 bool WasNpnNegotiated() const override; | 81 bool WasNpnNegotiated() const override; |
| 82 NextProto GetNegotiatedProtocol() const override; | 82 NextProto GetNegotiatedProtocol() const override; |
| 83 bool GetSSLInfo(SSLInfo* ssl_info) override; | 83 bool GetSSLInfo(SSLInfo* ssl_info) override; |
| 84 void GetConnectionAttempts(ConnectionAttempts* out) const override; | 84 void GetConnectionAttempts(ConnectionAttempts* out) const override; |
| 85 void ClearConnectionAttempts() override; | 85 void ClearConnectionAttempts() override; |
| 86 void AddConnectionAttempts(const ConnectionAttempts& attempts) override; | 86 void AddConnectionAttempts(const ConnectionAttempts& attempts) override; |
| (...skipping 24 matching lines...) Expand all Loading... |
| 111 // is run (Or Disconnect() is called), and reads / writes will return the same | 111 // is run (Or Disconnect() is called), and reads / writes will return the same |
| 112 // error asynchronously, until it becomes false, at which point they'll return | 112 // error asynchronously, until it becomes false, at which point they'll return |
| 113 // it synchronously. | 113 // it synchronously. |
| 114 bool error_pending_ = false; | 114 bool error_pending_ = false; |
| 115 // If this is not OK, all reads/writes will fail with this error. | 115 // If this is not OK, all reads/writes will fail with this error. |
| 116 int net_error_ = ERR_CONNECTION_CLOSED; | 116 int net_error_ = ERR_CONNECTION_CLOSED; |
| 117 | 117 |
| 118 int64_t total_bytes_read_ = 0; | 118 int64_t total_bytes_read_ = 0; |
| 119 int64_t total_bytes_written_ = 0; | 119 int64_t total_bytes_written_ = 0; |
| 120 | 120 |
| 121 BoundNetLog bound_net_log_; | 121 NetLogWithSource net_log_; |
| 122 | 122 |
| 123 IPEndPoint remote_address_; | 123 IPEndPoint remote_address_; |
| 124 | 124 |
| 125 base::WeakPtrFactory<FuzzedSocket> weak_factory_; | 125 base::WeakPtrFactory<FuzzedSocket> weak_factory_; |
| 126 | 126 |
| 127 DISALLOW_COPY_AND_ASSIGN(FuzzedSocket); | 127 DISALLOW_COPY_AND_ASSIGN(FuzzedSocket); |
| 128 }; | 128 }; |
| 129 | 129 |
| 130 } // namespace net | 130 } // namespace net |
| 131 | 131 |
| 132 #endif // NET_SOCKET_FUZZED_SOCKET_H_ | 132 #endif // NET_SOCKET_FUZZED_SOCKET_H_ |
| OLD | NEW |