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

Unified Diff: content/browser/renderer_host/p2p/socket_host_test_utils.h

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 | « no previous file | jingle/glue/channel_socket_adapter.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/p2p/socket_host_test_utils.h
diff --git a/content/browser/renderer_host/p2p/socket_host_test_utils.h b/content/browser/renderer_host/p2p/socket_host_test_utils.h
index 0f1aeb4ce86583f562e46c5f3f636c510fb3838c..79b47949321cc147ccd2918707d32a94e172e610 100644
--- a/content/browser/renderer_host/p2p/socket_host_test_utils.h
+++ b/content/browser/renderer_host/p2p/socket_host_test_utils.h
@@ -62,6 +62,8 @@ class FakeSocket : public net::StreamSocket {
const net::CompletionCallback& callback) OVERRIDE;
virtual int Write(net::IOBuffer* buf, int buf_len,
net::OldCompletionCallback* callback) OVERRIDE;
+ virtual int Write(net::IOBuffer* buf, int buf_len,
+ const net::CompletionCallback& callback) OVERRIDE;
virtual bool SetReceiveBufferSize(int32 size) OVERRIDE;
virtual bool SetSendBufferSize(int32 size) OVERRIDE;
virtual int Connect(net::OldCompletionCallback* callback) OVERRIDE;
@@ -179,6 +181,15 @@ int FakeSocket::Write(net::IOBuffer* buf, int buf_len,
}
return buf_len;
}
+int FakeSocket::Write(net::IOBuffer* buf, int buf_len,
+ const net::CompletionCallback& callback) {
+ DCHECK(buf);
+ if (written_data_) {
+ written_data_->insert(written_data_->end(),
+ buf->data(), buf->data() + buf_len);
+ }
+ return buf_len;
+}
bool FakeSocket::SetReceiveBufferSize(int32 size) {
« no previous file with comments | « no previous file | jingle/glue/channel_socket_adapter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698