| 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" |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 197 return new P2PSocketHostTcp(message_sender, socket_id, type, url_context); | 197 return new P2PSocketHostTcp(message_sender, socket_id, type, url_context); |
| 198 | 198 |
| 199 case P2P_SOCKET_STUN_TCP_CLIENT: | 199 case P2P_SOCKET_STUN_TCP_CLIENT: |
| 200 case P2P_SOCKET_STUN_SSLTCP_CLIENT: | 200 case P2P_SOCKET_STUN_SSLTCP_CLIENT: |
| 201 case P2P_SOCKET_STUN_TLS_CLIENT: | 201 case P2P_SOCKET_STUN_TLS_CLIENT: |
| 202 return new P2PSocketHostStunTcp( | 202 return new P2PSocketHostStunTcp( |
| 203 message_sender, socket_id, type, url_context); | 203 message_sender, socket_id, type, url_context); |
| 204 } | 204 } |
| 205 | 205 |
| 206 NOTREACHED(); | 206 NOTREACHED(); |
| 207 return NULL; | 207 return nullptr; |
| 208 } | 208 } |
| 209 | 209 |
| 210 void P2PSocketHost::StartRtpDump( | 210 void P2PSocketHost::StartRtpDump( |
| 211 bool incoming, | 211 bool incoming, |
| 212 bool outgoing, | 212 bool outgoing, |
| 213 const RenderProcessHost::WebRtcRtpPacketCallback& packet_callback) { | 213 const RenderProcessHost::WebRtcRtpPacketCallback& packet_callback) { |
| 214 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 214 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 215 DCHECK(!packet_callback.is_null()); | 215 DCHECK(!packet_callback.is_null()); |
| 216 DCHECK(incoming || outgoing); | 216 DCHECK(incoming || outgoing); |
| 217 | 217 |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 314 send_bytes_delayed_max_ = send_bytes_delayed_cur_; | 314 send_bytes_delayed_max_ = send_bytes_delayed_cur_; |
| 315 } | 315 } |
| 316 } | 316 } |
| 317 | 317 |
| 318 void P2PSocketHost::DecrementDelayedBytes(uint32_t size) { | 318 void P2PSocketHost::DecrementDelayedBytes(uint32_t size) { |
| 319 send_bytes_delayed_cur_ -= size; | 319 send_bytes_delayed_cur_ -= size; |
| 320 DCHECK_GE(send_bytes_delayed_cur_, 0); | 320 DCHECK_GE(send_bytes_delayed_cur_, 0); |
| 321 } | 321 } |
| 322 | 322 |
| 323 } // namespace content | 323 } // namespace content |
| OLD | NEW |