OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "net/base/sys_byteorder.h" | 7 #include "net/base/sys_byteorder.h" |
8 #include "content/browser/renderer_host/p2p/socket_host_tcp.h" | 8 #include "content/browser/renderer_host/p2p/socket_host_tcp.h" |
9 #include "content/browser/renderer_host/p2p/socket_host_tcp_server.h" | 9 #include "content/browser/renderer_host/p2p/socket_host_tcp_server.h" |
10 #include "content/browser/renderer_host/p2p/socket_host_udp.h" | 10 #include "content/browser/renderer_host/p2p/socket_host_udp.h" |
11 | 11 |
12 namespace content { | |
13 | |
12 namespace { | 14 namespace { |
jam
2011/08/24 00:24:27
no need for this to be in content namespace
Sergey Ulanov
2011/08/24 01:57:48
Done.
| |
13 const int kStunHeaderSize = 20; | 15 const int kStunHeaderSize = 20; |
14 const uint32 kStunMagicCookie = 0x2112A442; | 16 const uint32 kStunMagicCookie = 0x2112A442; |
15 } // namespace | 17 } // namespace |
16 | 18 |
17 P2PSocketHost::P2PSocketHost(IPC::Message::Sender* message_sender, | 19 P2PSocketHost::P2PSocketHost(IPC::Message::Sender* message_sender, |
18 int routing_id, int id) | 20 int routing_id, int id) |
19 : message_sender_(message_sender), | 21 : message_sender_(message_sender), |
20 routing_id_(routing_id), | 22 routing_id_(routing_id), |
21 id_(id), | 23 id_(id), |
22 state_(STATE_UNINITIALIZED) { | 24 state_(STATE_UNINITIALIZED) { |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
82 case P2P_SOCKET_TCP_SERVER: | 84 case P2P_SOCKET_TCP_SERVER: |
83 return new P2PSocketHostTcpServer(message_sender, routing_id, id); | 85 return new P2PSocketHostTcpServer(message_sender, routing_id, id); |
84 | 86 |
85 case P2P_SOCKET_TCP_CLIENT: | 87 case P2P_SOCKET_TCP_CLIENT: |
86 return new P2PSocketHostTcp(message_sender, routing_id, id); | 88 return new P2PSocketHostTcp(message_sender, routing_id, id); |
87 } | 89 } |
88 | 90 |
89 NOTREACHED(); | 91 NOTREACHED(); |
90 return NULL; | 92 return NULL; |
91 } | 93 } |
94 | |
95 } // namespace content | |
OLD | NEW |