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/sys_byteorder.h" | 7 #include "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" |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
65 } | 65 } |
66 | 66 |
67 // static | 67 // static |
68 bool P2PSocketHost::IsRequestOrResponse(StunMessageType type) { | 68 bool P2PSocketHost::IsRequestOrResponse(StunMessageType type) { |
69 return type == STUN_BINDING_REQUEST || type == STUN_BINDING_RESPONSE || | 69 return type == STUN_BINDING_REQUEST || type == STUN_BINDING_RESPONSE || |
70 type == STUN_ALLOCATE_REQUEST || type == STUN_ALLOCATE_RESPONSE; | 70 type == STUN_ALLOCATE_REQUEST || type == STUN_ALLOCATE_RESPONSE; |
71 } | 71 } |
72 | 72 |
73 // static | 73 // static |
74 P2PSocketHost* P2PSocketHost::Create( | 74 P2PSocketHost* P2PSocketHost::Create( |
75 IPC::Sender* message_sender, int id, P2PSocketType type) { | 75 IPC::Sender* message_sender, int id, P2PSocketType type, |
76 net::URLRequestContextGetter* context_getter) { | |
Sergey Ulanov
2013/06/20 01:50:02
use the same name here and in the header. I would
Mallinath (Gone from Chromium)
2013/06/20 05:24:15
Done.
| |
76 switch (type) { | 77 switch (type) { |
77 case P2P_SOCKET_UDP: | 78 case P2P_SOCKET_UDP: |
78 return new P2PSocketHostUdp(message_sender, id); | 79 return new P2PSocketHostUdp(message_sender, id); |
79 | 80 |
80 case P2P_SOCKET_TCP_SERVER: | 81 case P2P_SOCKET_TCP_SERVER: |
81 return new P2PSocketHostTcpServer( | 82 return new P2PSocketHostTcpServer( |
82 message_sender, id, P2P_SOCKET_TCP_CLIENT); | 83 message_sender, id, P2P_SOCKET_TCP_CLIENT, context_getter); |
83 | 84 |
84 case P2P_SOCKET_STUN_TCP_SERVER: | 85 case P2P_SOCKET_STUN_TCP_SERVER: |
85 return new P2PSocketHostTcpServer( | 86 return new P2PSocketHostTcpServer( |
86 message_sender, id, P2P_SOCKET_STUN_TCP_CLIENT); | 87 message_sender, id, P2P_SOCKET_STUN_TCP_CLIENT, context_getter); |
87 | 88 |
88 case P2P_SOCKET_TCP_CLIENT: | 89 case P2P_SOCKET_TCP_CLIENT: |
89 return new P2PSocketHostTcp(message_sender, id); | 90 return new P2PSocketHostTcp(message_sender, id, context_getter); |
90 | 91 |
91 case P2P_SOCKET_STUN_TCP_CLIENT: | 92 case P2P_SOCKET_STUN_TCP_CLIENT: |
92 return new P2PSocketHostStunTcp(message_sender, id); | 93 return new P2PSocketHostStunTcp(message_sender, id, context_getter); |
93 } | 94 } |
94 | 95 |
95 NOTREACHED(); | 96 NOTREACHED(); |
96 return NULL; | 97 return NULL; |
97 } | 98 } |
98 | 99 |
99 } // namespace content | 100 } // namespace content |
OLD | NEW |