| 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/renderer/p2p/ipc_socket_factory.h" | 5 #include "content/renderer/p2p/ipc_socket_factory.h" |
| 6 | 6 |
| 7 #include <deque> | 7 #include <deque> |
| 8 | 8 |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
| (...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 412 return NULL; | 412 return NULL; |
| 413 } | 413 } |
| 414 return socket.release(); | 414 return socket.release(); |
| 415 } | 415 } |
| 416 | 416 |
| 417 talk_base::AsyncPacketSocket* IpcPacketSocketFactory::CreateClientTcpSocket( | 417 talk_base::AsyncPacketSocket* IpcPacketSocketFactory::CreateClientTcpSocket( |
| 418 const talk_base::SocketAddress& local_address, | 418 const talk_base::SocketAddress& local_address, |
| 419 const talk_base::SocketAddress& remote_address, | 419 const talk_base::SocketAddress& remote_address, |
| 420 const talk_base::ProxyInfo& proxy_info, | 420 const talk_base::ProxyInfo& proxy_info, |
| 421 const std::string& user_agent, int opts) { | 421 const std::string& user_agent, int opts) { |
| 422 // TODO(sergeyu): Implement SSL support. | 422 P2PSocketType type; |
| 423 if (opts & talk_base::PacketSocketFactory::OPT_SSLTCP) | 423 if (opts & talk_base::PacketSocketFactory::OPT_SSLTCP) { |
| 424 return NULL; | 424 type = (opts & talk_base::PacketSocketFactory::OPT_STUN) ? |
| 425 | 425 P2P_SOCKET_STUN_SSLTCP_CLIENT : P2P_SOCKET_SSLTCP_CLIENT; |
| 426 P2PSocketType type = (opts & talk_base::PacketSocketFactory::OPT_STUN) ? | 426 } else { |
| 427 P2P_SOCKET_STUN_TCP_CLIENT : P2P_SOCKET_TCP_CLIENT; | 427 type = (opts & talk_base::PacketSocketFactory::OPT_STUN) ? |
| 428 P2P_SOCKET_STUN_TCP_CLIENT : P2P_SOCKET_TCP_CLIENT; |
| 429 } |
| 428 P2PSocketClient* socket_client = new P2PSocketClient(socket_dispatcher_); | 430 P2PSocketClient* socket_client = new P2PSocketClient(socket_dispatcher_); |
| 429 scoped_ptr<IpcPacketSocket> socket(new IpcPacketSocket()); | 431 scoped_ptr<IpcPacketSocket> socket(new IpcPacketSocket()); |
| 430 if (!socket->Init(type, socket_client, local_address, | 432 if (!socket->Init(type, socket_client, local_address, |
| 431 remote_address)) | 433 remote_address)) |
| 432 return NULL; | 434 return NULL; |
| 433 return socket.release(); | 435 return socket.release(); |
| 434 } | 436 } |
| 435 | 437 |
| 436 } // namespace content | 438 } // namespace content |
| OLD | NEW |