Chromium Code Reviews| Index: media/cast/test/utility/udp_proxy.cc |
| diff --git a/media/cast/test/utility/udp_proxy.cc b/media/cast/test/utility/udp_proxy.cc |
| index 4dbac83fa51980c25f4beba5784195dc2bad5d75..95640a364e3a4d9bea79c83ff3544977a52772ff 100644 |
| --- a/media/cast/test/utility/udp_proxy.cc |
| +++ b/media/cast/test/utility/udp_proxy.cc |
| @@ -438,7 +438,7 @@ void InterruptedPoissonProcess::InitOnIOThread( |
| const scoped_refptr<base::SingleThreadTaskRunner>& task_runner, |
| base::TickClock* clock) { |
| // Already initialized and started. |
| - if (task_runner_ && clock_) |
| + if (task_runner_.get() && clock_) |
| return; |
| task_runner_ = task_runner; |
| clock_ = clock; |
| @@ -692,7 +692,7 @@ class UDPProxyImpl : public UDPProxy { |
| result = net::ERR_INVALID_ARGUMENT; |
| } else { |
| VLOG(1) << "Destination:" << destination.ToString(); |
| - result = socket_->SendTo(buf, |
| + result = socket_->SendTo(buf.get(), |
|
ddorwin
2014/08/25 21:26:39
I believe this is a pointer to a RefCounted object
dcheng
2014/08/25 21:33:25
Right, but before it was depending on the conversi
hubbe
2014/08/27 00:46:21
Explicit conversion is fine here.
The buffers life
|
| static_cast<int>(buf_size), |
| destination, |
| base::Bind(&UDPProxyImpl::AllowWrite, |
| @@ -773,12 +773,11 @@ class UDPProxyImpl : public UDPProxy { |
| scoped_refptr<net::IOBuffer> recv_buf = |
| new net::WrappedIOBuffer(reinterpret_cast<char*>(&packet_->front())); |
| int len = socket_->RecvFrom( |
| - recv_buf, |
| + recv_buf.get(), |
|
ddorwin
2014/08/25 21:26:40
ditto
dcheng
2014/08/25 21:33:25
See above.
|
| kMaxPacketSize, |
| &recv_address_, |
| - base::Bind(&UDPProxyImpl::ReadCallback, |
| - base::Unretained(this), |
| - recv_buf)); |
| + base::Bind( |
| + &UDPProxyImpl::ReadCallback, base::Unretained(this), recv_buf)); |
| if (len == net::ERR_IO_PENDING) |
| break; |
| ProcessPacket(recv_buf, len); |