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

Unified Diff: net/socket/tcp_client_socket_libevent.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/tcp_client_socket_libevent.h ('k') | net/socket/tcp_client_socket_win.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/socket/tcp_client_socket_libevent.cc
===================================================================
--- net/socket/tcp_client_socket_libevent.cc (revision 113718)
+++ net/socket/tcp_client_socket_libevent.cc (working copy)
@@ -574,43 +574,7 @@
old_write_callback_ = callback;
return ERR_IO_PENDING;
}
-int TCPClientSocketLibevent::Write(IOBuffer* buf,
- int buf_len,
- const CompletionCallback& callback) {
- DCHECK(CalledOnValidThread());
- DCHECK_NE(kInvalidSocket, socket_);
- DCHECK(!waiting_connect());
- DCHECK(!old_write_callback_ && write_callback_.is_null());
- // Synchronous operation not supported
- DCHECK(!callback.is_null());
- DCHECK_GT(buf_len, 0);
- int nwrite = InternalWrite(buf, buf_len);
- if (nwrite >= 0) {
- base::StatsCounter write_bytes("tcp.write_bytes");
- write_bytes.Add(nwrite);
- if (nwrite > 0)
- use_history_.set_was_used_to_convey_data();
- net_log_.AddByteTransferEvent(NetLog::TYPE_SOCKET_BYTES_SENT, nwrite,
- buf->data());
- return nwrite;
- }
- if (errno != EAGAIN && errno != EWOULDBLOCK)
- return MapSystemError(errno);
-
- if (!MessageLoopForIO::current()->WatchFileDescriptor(
- socket_, true, MessageLoopForIO::WATCH_WRITE,
- &write_socket_watcher_, &write_watcher_)) {
- DVLOG(1) << "WatchFileDescriptor failed on write, errno " << errno;
- return MapSystemError(errno);
- }
-
- write_buf_ = buf;
- write_buf_len_ = buf_len;
- write_callback_ = callback;
- return ERR_IO_PENDING;
-}
-
int TCPClientSocketLibevent::InternalWrite(IOBuffer* buf, int buf_len) {
int nwrite;
if (use_tcp_fastopen_ && !tcp_fastopen_connected_) {
Property changes on: net/socket/tcp_client_socket_libevent.cc
___________________________________________________________________
Deleted: svn:mergeinfo
« no previous file with comments | « net/socket/tcp_client_socket_libevent.h ('k') | net/socket/tcp_client_socket_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698