Index: remoting/protocol/fake_datagram_socket.h |
diff --git a/remoting/protocol/fake_datagram_socket.h b/remoting/protocol/fake_datagram_socket.h |
index 7270e1d8ca5f04d2949a0cdb14c3825b5820a9d9..a22751d05ced387270b19f20d87c9a9bd3bcd577 100644 |
--- a/remoting/protocol/fake_datagram_socket.h |
+++ b/remoting/protocol/fake_datagram_socket.h |
@@ -41,6 +41,13 @@ class FakeDatagramSocket : public P2PDatagramSocket { |
return written_packets_; |
} |
+ // Enables asynchronous Write(). |
+ void set_async_send(bool async_send) { async_send_ = async_send; } |
+ |
+ // Set error codes for the next Write() call. Once returned the |
+ // value is automatically reset to net::OK . |
+ void set_next_send_error(int error) { next_send_error_ = error; } |
+ |
void AppendInputPacket(const std::string& data); |
// Current position in the input in number of packets, i.e. number of finished |
@@ -62,6 +69,14 @@ class FakeDatagramSocket : public P2PDatagramSocket { |
private: |
int CopyReadData(const scoped_refptr<net::IOBuffer>& buf, int buf_len); |
+ void DoAsyncSend(const scoped_refptr<net::IOBuffer>& buf, int buf_len, |
+ const net::CompletionCallback& callback); |
+ int DoSend(const scoped_refptr<net::IOBuffer>& buf, int buf_len); |
+ |
+ bool async_send_ = false; |
+ bool send_pending_ = false; |
+ int next_send_error_ = 0; |
+ |
base::WeakPtr<FakeDatagramSocket> peer_socket_; |
scoped_refptr<net::IOBuffer> read_buffer_; |