Chromium Code Reviews| 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..66c4869b6fd9b73bc1fc3f7a6f68b3cfd0985419 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)); |
|
Ryan Sleevi
2014/07/11 19:04:42
This is where I would mention why you're making th
byungchul
2014/07/11 21:35:52
Done.
|
| 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(const 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(const scoped_refptr<IOBuffer>& buf, |
| const CompletionCallback& callback, |
| int rv) const { |
| DCHECK_NE(ERR_IO_PENDING, rv); |