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

Unified Diff: jingle/glue/pseudotcp_adapter_unittest.cc

Issue 8831001: base::Bind: Convert Socket::Write. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix alignment. Created 9 years 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 | « jingle/glue/pseudotcp_adapter.cc ('k') | jingle/notifier/base/fake_ssl_client_socket.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: jingle/glue/pseudotcp_adapter_unittest.cc
diff --git a/jingle/glue/pseudotcp_adapter_unittest.cc b/jingle/glue/pseudotcp_adapter_unittest.cc
index 6d803a51b38eca2dde92b864f88f8340397a80cd..94b403f62b9916ee1624aeb1678599c4df51c394 100644
--- a/jingle/glue/pseudotcp_adapter_unittest.cc
+++ b/jingle/glue/pseudotcp_adapter_unittest.cc
@@ -174,6 +174,20 @@ class FakeSocket : public net::Socket {
return buf_len;
}
+ virtual int Write(net::IOBuffer* buf, int buf_len,
+ const net::CompletionCallback& callback) OVERRIDE {
+ DCHECK(buf);
+ if (peer_socket_) {
+ MessageLoop::current()->PostDelayedTask(
+ FROM_HERE,
+ base::Bind(&FakeSocket::AppendInputPacket,
+ base::Unretained(peer_socket_),
+ std::vector<char>(buf->data(), buf->data() + buf_len)),
+ latency_ms_);
+ }
+
+ return buf_len;
+ }
virtual bool SetReceiveBufferSize(int32 size) OVERRIDE {
NOTIMPLEMENTED();
« no previous file with comments | « jingle/glue/pseudotcp_adapter.cc ('k') | jingle/notifier/base/fake_ssl_client_socket.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698