Index: net/socket/tcp_socket_libevent.cc |
diff --git a/net/socket/tcp_socket_libevent.cc b/net/socket/tcp_socket_libevent.cc |
index fe08f9c227f0f42e1190f12066663efcbaacf620..d60afa0356092e80a278e4dbc01511a4d3a39246 100644 |
--- a/net/socket/tcp_socket_libevent.cc |
+++ b/net/socket/tcp_socket_libevent.cc |
@@ -211,7 +211,7 @@ int TCPSocketLibevent::Read(IOBuffer* buf, |
int rv = socket_->Read( |
buf, buf_len, |
base::Bind(&TCPSocketLibevent::ReadCompleted, |
- base::Unretained(this), base::Unretained(buf), callback)); |
+ base::Unretained(this), make_scoped_refptr(buf), callback)); |
if (rv >= 0) |
RecordFastOpenStatus(); |
if (rv != ERR_IO_PENDING) |
@@ -227,7 +227,7 @@ int TCPSocketLibevent::Write(IOBuffer* buf, |
CompletionCallback write_callback = |
base::Bind(&TCPSocketLibevent::WriteCompleted, |
- base::Unretained(this), base::Unretained(buf), callback); |
+ base::Unretained(this), make_scoped_refptr(buf), callback); |
int rv; |
if (use_tcp_fastopen_ && !tcp_fastopen_connected_) { |
rv = TcpFastOpenWrite(buf, buf_len, write_callback); |
@@ -485,7 +485,7 @@ void TCPSocketLibevent::LogConnectEnd(int net_error) const { |
storage.addr_len)); |
} |
-void TCPSocketLibevent::ReadCompleted(IOBuffer* buf, |
+void TCPSocketLibevent::ReadCompleted(scoped_refptr<IOBuffer> buf, |
const CompletionCallback& callback, |
int rv) { |
DCHECK_NE(ERR_IO_PENDING, rv); |
@@ -510,7 +510,7 @@ int TCPSocketLibevent::HandleReadCompleted(IOBuffer* buf, int rv) { |
return rv; |
} |
-void TCPSocketLibevent::WriteCompleted(IOBuffer* buf, |
+void TCPSocketLibevent::WriteCompleted(scoped_refptr<IOBuffer> buf, |
const CompletionCallback& callback, |
int rv) const { |
DCHECK_NE(ERR_IO_PENDING, rv); |