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

Unified Diff: net/socket/web_socket_server_socket_unittest.cc

Issue 8889036: Revert 113699 - base::Bind: Convert Socket::Write. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: 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 | « net/socket/web_socket_server_socket.cc ('k') | net/spdy/spdy_proxy_client_socket.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/socket/web_socket_server_socket_unittest.cc
===================================================================
--- net/socket/web_socket_server_socket_unittest.cc (revision 113718)
+++ net/socket/web_socket_server_socket_unittest.cc (working copy)
@@ -157,24 +157,6 @@
}
MessageLoop::current()->PostTask(FROM_HERE,
method_factory_.NewRunnableMethod(
- &TestingTransportSocket::DoOldWriteCallback, callback, lot));
- return net::ERR_IO_PENDING;
- }
- virtual int Write(net::IOBuffer* buf, int buf_len,
- const net::CompletionCallback& callback) {
- CHECK_GT(buf_len, 0);
- int remaining = answer_->BytesRemaining();
- CHECK_GE(remaining, buf_len);
- int lot = std::min(remaining, buf_len);
- if (GetRand(0, 1))
- lot = GetRand(1, lot);
- std::copy(buf->data(), buf->data() + lot, answer_->data());
- answer_->DidConsume(lot);
- if (GetRand(0, 1)) {
- return lot;
- }
- MessageLoop::current()->PostTask(FROM_HERE,
- method_factory_.NewRunnableMethod(
&TestingTransportSocket::DoWriteCallback, callback, lot));
return net::ERR_IO_PENDING;
}
@@ -210,14 +192,10 @@
}
}
- void DoOldWriteCallback(net::OldCompletionCallback* callback, int result) {
+ void DoWriteCallback(net::OldCompletionCallback* callback, int result) {
if (callback)
callback->Run(result);
}
- void DoWriteCallback(const net::CompletionCallback& callback, int result) {
- if (!callback.is_null())
- callback.Run(result);
- }
bool is_closed_;
« no previous file with comments | « net/socket/web_socket_server_socket.cc ('k') | net/spdy/spdy_proxy_client_socket.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698