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_tcp.h" | 5 #include "content/browser/renderer_host/p2p/socket_host_tcp.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/location.h" | 10 #include "base/location.h" |
11 #include "base/single_thread_task_runner.h" | 11 #include "base/single_thread_task_runner.h" |
12 #include "base/sys_byteorder.h" | 12 #include "base/sys_byteorder.h" |
13 #include "content/common/p2p_messages.h" | 13 #include "content/common/p2p_messages.h" |
14 #include "ipc/ipc_sender.h" | 14 #include "ipc/ipc_sender.h" |
15 #include "jingle/glue/fake_ssl_client_socket.h" | 15 #include "jingle/glue/fake_ssl_client_socket.h" |
16 #include "jingle/glue/proxy_resolving_client_socket.h" | 16 #include "jingle/glue/proxy_resolving_client_socket.h" |
17 #include "net/base/io_buffer.h" | 17 #include "net/base/io_buffer.h" |
18 #include "net/base/net_errors.h" | 18 #include "net/base/net_errors.h" |
19 #include "net/base/net_util.h" | 19 #include "net/base/net_util.h" |
20 #include "net/socket/client_socket_factory.h" | 20 #include "net/socket/client_socket_factory.h" |
21 #include "net/socket/client_socket_handle.h" | 21 #include "net/socket/client_socket_handle.h" |
22 #include "net/socket/ssl_client_socket.h" | 22 #include "net/socket/ssl_client_socket.h" |
23 #include "net/socket/tcp_client_socket.h" | 23 #include "net/socket/tcp_client_socket.h" |
24 #include "net/url_request/url_request_context.h" | 24 #include "net/url_request/url_request_context.h" |
25 #include "net/url_request/url_request_context_getter.h" | 25 #include "net/url_request/url_request_context_getter.h" |
26 #include "third_party/libjingle/source/talk/media/base/rtputils.h" | 26 #include "third_party/webrtc/media/base/rtputils.h" |
27 | 27 |
28 namespace { | 28 namespace { |
29 | 29 |
30 typedef uint16_t PacketLength; | 30 typedef uint16_t PacketLength; |
31 const int kPacketHeaderSize = sizeof(PacketLength); | 31 const int kPacketHeaderSize = sizeof(PacketLength); |
32 const int kReadBufferSize = 4096; | 32 const int kReadBufferSize = 4096; |
33 const int kPacketLengthOffset = 2; | 33 const int kPacketLengthOffset = 2; |
34 const int kTurnChannelDataHeaderSize = 4; | 34 const int kTurnChannelDataHeaderSize = 4; |
35 const int kRecvSocketBufferSize = 128 * 1024; | 35 const int kRecvSocketBufferSize = 128 * 1024; |
36 const int kSendSocketBufferSize = 128 * 1024; | 36 const int kSendSocketBufferSize = 128 * 1024; |
(...skipping 598 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
635 } else { | 635 } else { |
636 packet_size += kTurnChannelDataHeaderSize; | 636 packet_size += kTurnChannelDataHeaderSize; |
637 // Calculate any padding if present. | 637 // Calculate any padding if present. |
638 if (packet_size % 4) | 638 if (packet_size % 4) |
639 *pad_bytes = 4 - packet_size % 4; | 639 *pad_bytes = 4 - packet_size % 4; |
640 } | 640 } |
641 return packet_size; | 641 return packet_size; |
642 } | 642 } |
643 | 643 |
644 } // namespace content | 644 } // namespace content |
OLD | NEW |