Index: remoting/protocol/fake_datagram_socket.h |
diff --git a/remoting/protocol/fake_datagram_socket.h b/remoting/protocol/fake_datagram_socket.h |
index 9669c0bd01cccc2be970dbe21b46bee6c1edfb32..8f9653ee594fc0b2553b32e6de4ff3180e607357 100644 |
--- a/remoting/protocol/fake_datagram_socket.h |
+++ b/remoting/protocol/fake_datagram_socket.h |
@@ -12,8 +12,8 @@ |
#include "base/memory/scoped_ptr.h" |
#include "base/memory/weak_ptr.h" |
#include "net/base/completion_callback.h" |
-#include "net/socket/socket.h" |
#include "remoting/protocol/datagram_channel_factory.h" |
+#include "remoting/protocol/p2p_datagram_socket.h" |
namespace base { |
class SingleThreadTaskRunner; |
@@ -22,7 +22,7 @@ class SingleThreadTaskRunner; |
namespace remoting { |
namespace protocol { |
-// FakeDatagramSocket implement net::StreamSocket interface. All data written to |
+// FakeDatagramSocket implement P2PStreamSocket interface. All data written to |
// FakeDatagramSocket is stored in a buffer returned by written_packets(). |
// Read() reads data from another buffer that can be set with |
// AppendInputPacket(). Pending reads are supported, so if there is a pending |
@@ -32,7 +32,7 @@ namespace protocol { |
// PairWith() method, e.g.: a->PairWith(b). After this all data |
// written to |a| can be read from |b| and vice versa. Two connected |
// sockets |a| and |b| must be created and used on the same thread. |
-class FakeDatagramSocket : public net::Socket { |
+class FakeDatagramSocket : public P2PDatagramSocket { |
public: |
FakeDatagramSocket(); |
~FakeDatagramSocket() override; |
@@ -44,7 +44,7 @@ class FakeDatagramSocket : public net::Socket { |
void AppendInputPacket(const std::string& data); |
// Current position in the input in number of packets, i.e. number of finished |
- // Read() calls. |
+ // Recv() calls. |
int input_pos() const { return input_pos_; } |
// Pairs the socket with |peer_socket|. Deleting either of the paired sockets |
@@ -53,15 +53,11 @@ class FakeDatagramSocket : public net::Socket { |
base::WeakPtr<FakeDatagramSocket> GetWeakPtr(); |
- // net::Socket implementation. |
- int Read(net::IOBuffer* buf, |
- int buf_len, |
+ // P2PDatagramSocket implementation. |
+ int Recv(net::IOBuffer* buf, int buf_len, |
+ const net::CompletionCallback& callback) override; |
+ int Send(net::IOBuffer* buf, int buf_len, |
const net::CompletionCallback& callback) override; |
- int Write(net::IOBuffer* buf, |
- int buf_len, |
- const net::CompletionCallback& callback) override; |
- int SetReceiveBufferSize(int32 size) override; |
- int SetSendBufferSize(int32 size) override; |
private: |
int CopyReadData(net::IOBuffer* buf, int buf_len); |