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

Side by Side Diff: media/cast/net/udp_transport.cc

Issue 654843007: Cast: Increase UDP socket send buffer size (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: move code Created 6 years, 2 months 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 unified diff | Download patch
OLDNEW
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
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
OLDNEW
« media/cast/net/cast_transport_sender_impl.cc ('K') | « media/cast/net/udp_transport.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698