| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "media/cast/net/udp_transport.h" | 5 #include "media/cast/net/udp_transport.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 214 return false; | 214 return false; |
| 215 } | 215 } |
| 216 OnSent(buf, packet, base::Closure(), result); | 216 OnSent(buf, packet, base::Closure(), result); |
| 217 return true; | 217 return true; |
| 218 } | 218 } |
| 219 | 219 |
| 220 int64 UdpTransport::GetBytesSent() { | 220 int64 UdpTransport::GetBytesSent() { |
| 221 return bytes_sent_; | 221 return bytes_sent_; |
| 222 } | 222 } |
| 223 | 223 |
| 224 int UdpTransport::SetSendBufferSize(int32 size) { |
| 225 return udp_socket_->SetSendBufferSize(size); |
| 226 } |
| 227 |
| 224 void UdpTransport::OnSent(const scoped_refptr<net::IOBuffer>& buf, | 228 void UdpTransport::OnSent(const scoped_refptr<net::IOBuffer>& buf, |
| 225 PacketRef packet, | 229 PacketRef packet, |
| 226 const base::Closure& cb, | 230 const base::Closure& cb, |
| 227 int result) { | 231 int result) { |
| 228 DCHECK(io_thread_proxy_->RunsTasksOnCurrentThread()); | 232 DCHECK(io_thread_proxy_->RunsTasksOnCurrentThread()); |
| 229 | 233 |
| 230 send_pending_ = false; | 234 send_pending_ = false; |
| 231 if (result < 0) { | 235 if (result < 0) { |
| 232 VLOG(1) << "Failed to send packet: " << result << "."; | 236 VLOG(1) << "Failed to send packet: " << result << "."; |
| 233 } | 237 } |
| 234 ScheduleReceiveNextPacket(); | 238 ScheduleReceiveNextPacket(); |
| 235 | 239 |
| 236 if (!cb.is_null()) { | 240 if (!cb.is_null()) { |
| 237 cb.Run(); | 241 cb.Run(); |
| 238 } | 242 } |
| 239 } | 243 } |
| 240 | 244 |
| 241 } // namespace cast | 245 } // namespace cast |
| 242 } // namespace media | 246 } // namespace media |
| OLD | NEW |