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/metrics/field_trial.h" | 8 #include "base/metrics/field_trial.h" |
9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
11 #include "base/strings/string_number_conversions.h" | 11 #include "base/strings/string_number_conversions.h" |
12 #include "base/trace_event/trace_event.h" | 12 #include "base/trace_event/trace_event.h" |
13 #include "build/build_config.h" | 13 #include "build/build_config.h" |
14 #include "content/browser/renderer_host/p2p/socket_host_throttler.h" | 14 #include "content/browser/renderer_host/p2p/socket_host_throttler.h" |
15 #include "content/common/p2p_messages.h" | 15 #include "content/common/p2p_messages.h" |
16 #include "content/public/browser/content_browser_client.h" | 16 #include "content/public/browser/content_browser_client.h" |
17 #include "content/public/common/content_client.h" | 17 #include "content/public/common/content_client.h" |
18 #include "ipc/ipc_sender.h" | 18 #include "ipc/ipc_sender.h" |
19 #include "net/base/io_buffer.h" | 19 #include "net/base/io_buffer.h" |
20 #include "net/base/net_errors.h" | 20 #include "net/base/net_errors.h" |
21 #include "net/base/net_util.h" | 21 #include "net/base/net_util.h" |
22 #include "third_party/libjingle/source/talk/media/base/rtputils.h" | 22 #include "third_party/webrtc/media/base/rtputils.h" |
23 | 23 |
24 namespace { | 24 namespace { |
25 | 25 |
26 // UDP packets cannot be bigger than 64k. | 26 // UDP packets cannot be bigger than 64k. |
27 const int kReadBufferSize = 65536; | 27 const int kReadBufferSize = 65536; |
28 // Socket receive buffer size. | 28 // Socket receive buffer size. |
29 const int kRecvSocketBufferSize = 65536; // 64K | 29 const int kRecvSocketBufferSize = 65536; // 64K |
30 | 30 |
31 // Defines set of transient errors. These errors are ignored when we get them | 31 // Defines set of transient errors. These errors are ignored when we get them |
32 // from sendto() or recvfrom() calls. | 32 // from sendto() or recvfrom() calls. |
(...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
392 case P2P_SOCKET_OPT_DSCP: | 392 case P2P_SOCKET_OPT_DSCP: |
393 return (net::OK == socket_->SetDiffServCodePoint( | 393 return (net::OK == socket_->SetDiffServCodePoint( |
394 static_cast<net::DiffServCodePoint>(value))) ? true : false; | 394 static_cast<net::DiffServCodePoint>(value))) ? true : false; |
395 default: | 395 default: |
396 NOTREACHED(); | 396 NOTREACHED(); |
397 return false; | 397 return false; |
398 } | 398 } |
399 } | 399 } |
400 | 400 |
401 } // namespace content | 401 } // namespace content |
OLD | NEW |