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

Unified Diff: remoting/protocol/fake_datagram_socket.h

Issue 1273233002: Implement QuicChannel and QuicChannelFactory (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « remoting/protocol/BUILD.gn ('k') | remoting/protocol/fake_datagram_socket.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_;
« no previous file with comments | « remoting/protocol/BUILD.gn ('k') | remoting/protocol/fake_datagram_socket.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698