| 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 "crypto/hmac.h" | 14 #include "crypto/hmac.h" |
| 15 #include "third_party/libjingle/source/talk/p2p/base/stun.h" | |
| 16 #include "third_party/webrtc/base/asyncpacketsocket.h" | 15 #include "third_party/webrtc/base/asyncpacketsocket.h" |
| 17 #include "third_party/webrtc/base/byteorder.h" | 16 #include "third_party/webrtc/base/byteorder.h" |
| 18 #include "third_party/webrtc/base/messagedigest.h" | 17 #include "third_party/webrtc/base/messagedigest.h" |
| 18 #include "third_party/webrtc/p2p/base/stun.h" |
| 19 | 19 |
| 20 namespace { | 20 namespace { |
| 21 | 21 |
| 22 const uint32 kStunMagicCookie = 0x2112A442; | 22 const uint32 kStunMagicCookie = 0x2112A442; |
| 23 const size_t kMinRtpHeaderLength = 12; | 23 const size_t kMinRtpHeaderLength = 12; |
| 24 const size_t kMinRtcpHeaderLength = 8; | 24 const size_t kMinRtcpHeaderLength = 8; |
| 25 const size_t kRtpExtensionHeaderLength = 4; | 25 const size_t kRtpExtensionHeaderLength = 4; |
| 26 const size_t kDtlsRecordHeaderLength = 13; | 26 const size_t kDtlsRecordHeaderLength = 13; |
| 27 const size_t kTurnChannelHeaderLength = 4; | 27 const size_t kTurnChannelHeaderLength = 4; |
| 28 const size_t kAbsSendTimeExtensionLength = 3; | 28 const size_t kAbsSendTimeExtensionLength = 3; |
| (...skipping 656 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 685 send_bytes_delayed_max_ = send_bytes_delayed_cur_; | 685 send_bytes_delayed_max_ = send_bytes_delayed_cur_; |
| 686 } | 686 } |
| 687 } | 687 } |
| 688 | 688 |
| 689 void P2PSocketHost::DecrementDelayedBytes(uint32 size) { | 689 void P2PSocketHost::DecrementDelayedBytes(uint32 size) { |
| 690 send_bytes_delayed_cur_ -= size; | 690 send_bytes_delayed_cur_ -= size; |
| 691 DCHECK_GE(send_bytes_delayed_cur_, 0); | 691 DCHECK_GE(send_bytes_delayed_cur_, 0); |
| 692 } | 692 } |
| 693 | 693 |
| 694 } // namespace content | 694 } // namespace content |
| OLD | NEW |