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.h" | 5 #include "content/browser/renderer_host/p2p/socket_host.h" |
6 | 6 |
7 #include "base/metrics/histogram.h" | 7 #include "base/metrics/histogram.h" |
8 #include "base/sys_byteorder.h" | 8 #include "base/sys_byteorder.h" |
9 #include "content/browser/renderer_host/p2p/socket_host_tcp.h" | 9 #include "content/browser/renderer_host/p2p/socket_host_tcp.h" |
10 #include "content/browser/renderer_host/p2p/socket_host_tcp_server.h" | 10 #include "content/browser/renderer_host/p2p/socket_host_tcp_server.h" |
11 #include "content/browser/renderer_host/p2p/socket_host_udp.h" | 11 #include "content/browser/renderer_host/p2p/socket_host_udp.h" |
12 #include "content/browser/renderer_host/render_process_host_impl.h" | 12 #include "content/browser/renderer_host/render_process_host_impl.h" |
13 #include "content/public/browser/browser_thread.h" | 13 #include "content/public/browser/browser_thread.h" |
14 #include "third_party/libjingle/source/talk/media/base/rtputils.h" | 14 #include "third_party/webrtc/media/base/rtputils.h" |
15 #include "third_party/libjingle/source/talk/media/base/turnutils.h" | 15 #include "third_party/webrtc/media/base/turnutils.h" |
16 | 16 |
17 namespace { | 17 namespace { |
18 | 18 |
19 const uint32_t kStunMagicCookie = 0x2112A442; | 19 const uint32_t kStunMagicCookie = 0x2112A442; |
20 const size_t kMinRtcpHeaderLength = 8; | 20 const size_t kMinRtcpHeaderLength = 8; |
21 const size_t kDtlsRecordHeaderLength = 13; | 21 const size_t kDtlsRecordHeaderLength = 13; |
22 | 22 |
23 bool IsDtlsPacket(const char* data, size_t length) { | 23 bool IsDtlsPacket(const char* data, size_t length) { |
24 const uint8_t* u = reinterpret_cast<const uint8_t*>(data); | 24 const uint8_t* u = reinterpret_cast<const uint8_t*>(data); |
25 return (length >= kDtlsRecordHeaderLength && (u[0] > 19 && u[0] < 64)); | 25 return (length >= kDtlsRecordHeaderLength && (u[0] > 19 && u[0] < 64)); |
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
267 send_bytes_delayed_max_ = send_bytes_delayed_cur_; | 267 send_bytes_delayed_max_ = send_bytes_delayed_cur_; |
268 } | 268 } |
269 } | 269 } |
270 | 270 |
271 void P2PSocketHost::DecrementDelayedBytes(uint32_t size) { | 271 void P2PSocketHost::DecrementDelayedBytes(uint32_t size) { |
272 send_bytes_delayed_cur_ -= size; | 272 send_bytes_delayed_cur_ -= size; |
273 DCHECK_GE(send_bytes_delayed_cur_, 0); | 273 DCHECK_GE(send_bytes_delayed_cur_, 0); |
274 } | 274 } |
275 | 275 |
276 } // namespace content | 276 } // namespace content |
OLD | NEW |