OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "content/browser/renderer_host/p2p/socket_host_udp.h" | 5 #include "content/browser/renderer_host/p2p/socket_host_udp.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/debug/trace_event.h" | 9 #include "base/debug/trace_event.h" |
10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
227 int result = socket_->SetDiffServCodePoint(packet.dscp); | 227 int result = socket_->SetDiffServCodePoint(packet.dscp); |
228 if (result == net::OK) { | 228 if (result == net::OK) { |
229 last_dscp_ = packet.dscp; | 229 last_dscp_ = packet.dscp; |
230 } else if (!IsTransientError(result) && last_dscp_ != net::DSCP_CS0) { | 230 } else if (!IsTransientError(result) && last_dscp_ != net::DSCP_CS0) { |
231 // We receieved a non-transient error, and it seems we have | 231 // We receieved a non-transient error, and it seems we have |
232 // not changed the DSCP in the past, disable DSCP as it unlikely | 232 // not changed the DSCP in the past, disable DSCP as it unlikely |
233 // to work in the future. | 233 // to work in the future. |
234 last_dscp_ = net::DSCP_NO_CHANGE; | 234 last_dscp_ = net::DSCP_NO_CHANGE; |
235 } | 235 } |
236 } | 236 } |
| 237 MaybeUpdateRtpSendTimeExtn(packet.data->data(), packet.size); |
237 int result = socket_->SendTo( | 238 int result = socket_->SendTo( |
238 packet.data.get(), | 239 packet.data.get(), |
239 packet.size, | 240 packet.size, |
240 packet.to, | 241 packet.to, |
241 base::Bind(&P2PSocketHostUdp::OnSend, base::Unretained(this), packet.id)); | 242 base::Bind(&P2PSocketHostUdp::OnSend, base::Unretained(this), packet.id)); |
242 | 243 |
243 // sendto() may return an error, e.g. if we've received an ICMP Destination | 244 // sendto() may return an error, e.g. if we've received an ICMP Destination |
244 // Unreachable message. When this happens try sending the same packet again, | 245 // Unreachable message. When this happens try sending the same packet again, |
245 // and just drop it if it fails again. | 246 // and just drop it if it fails again. |
246 if (IsTransientError(result)) { | 247 if (IsTransientError(result)) { |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
305 case P2P_SOCKET_OPT_DSCP: | 306 case P2P_SOCKET_OPT_DSCP: |
306 return (net::OK == socket_->SetDiffServCodePoint( | 307 return (net::OK == socket_->SetDiffServCodePoint( |
307 static_cast<net::DiffServCodePoint>(value))) ? true : false; | 308 static_cast<net::DiffServCodePoint>(value))) ? true : false; |
308 default: | 309 default: |
309 NOTREACHED(); | 310 NOTREACHED(); |
310 return false; | 311 return false; |
311 } | 312 } |
312 } | 313 } |
313 | 314 |
314 } // namespace content | 315 } // namespace content |
OLD | NEW |