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

Unified Diff: remoting/protocol/fake_datagram_socket.cc

Issue 1197853003: Add P2PDatagramSocket and P2PStreamSocket interfaces. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 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
Index: remoting/protocol/fake_datagram_socket.cc
diff --git a/remoting/protocol/fake_datagram_socket.cc b/remoting/protocol/fake_datagram_socket.cc
index 9bd4ede48b336e0356aebfa8b7342676f68dd1cc..25ecc02599cb761720e9ece18d752f89af5b17ce 100644
--- a/remoting/protocol/fake_datagram_socket.cc
+++ b/remoting/protocol/fake_datagram_socket.cc
@@ -51,7 +51,7 @@ base::WeakPtr<FakeDatagramSocket> FakeDatagramSocket::GetWeakPtr() {
return weak_factory_.GetWeakPtr();
}
-int FakeDatagramSocket::Read(net::IOBuffer* buf, int buf_len,
+int FakeDatagramSocket::Recv(net::IOBuffer* buf, int buf_len,
const net::CompletionCallback& callback) {
EXPECT_TRUE(task_runner_->BelongsToCurrentThread());
if (input_pos_ < static_cast<int>(input_packets_.size())) {
@@ -64,8 +64,8 @@ int FakeDatagramSocket::Read(net::IOBuffer* buf, int buf_len,
}
}
-int FakeDatagramSocket::Write(net::IOBuffer* buf, int buf_len,
- const net::CompletionCallback& callback) {
+int FakeDatagramSocket::Send(net::IOBuffer* buf, int buf_len,
+ const net::CompletionCallback& callback) {
EXPECT_TRUE(task_runner_->BelongsToCurrentThread());
written_packets_.push_back(std::string());
written_packets_.back().assign(buf->data(), buf->data() + buf_len);
@@ -73,24 +73,13 @@ int FakeDatagramSocket::Write(net::IOBuffer* buf, int buf_len,
if (peer_socket_.get()) {
task_runner_->PostTask(
FROM_HERE,
- base::Bind(&FakeDatagramSocket::AppendInputPacket,
- peer_socket_,
+ base::Bind(&FakeDatagramSocket::AppendInputPacket, peer_socket_,
std::string(buf->data(), buf->data() + buf_len)));
}
return buf_len;
}
-int FakeDatagramSocket::SetReceiveBufferSize(int32 size) {
- NOTIMPLEMENTED();
- return net::ERR_NOT_IMPLEMENTED;
-}
-
-int FakeDatagramSocket::SetSendBufferSize(int32 size) {
- NOTIMPLEMENTED();
- return net::ERR_NOT_IMPLEMENTED;
-}
-
int FakeDatagramSocket::CopyReadData(net::IOBuffer* buf, int buf_len) {
int size = std::min(
buf_len, static_cast<int>(input_packets_[input_pos_].size()));

Powered by Google App Engine
This is Rietveld 408576698