From f7a8aee098ac5d816df06b0f72224341915817fa Mon Sep 17 00:00:00 2001 From: "mallinath@chromium.org" Date: Sat, 15 Jun 2013 05:13:32 +0000 Subject: Use STUN_TCP_SOCKET also while checking for tcp client socket. R=sergeyu@chromium.org Review URL: https://chromiumcodereview.appspot.com/17093004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@206565 0039d316-1c4b-4281-b951-d872f2087c98 --- content/renderer/p2p/ipc_socket_factory.cc | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'content/renderer/p2p') diff --git a/content/renderer/p2p/ipc_socket_factory.cc b/content/renderer/p2p/ipc_socket_factory.cc index bbc87e1..28f8007 100644 --- a/content/renderer/p2p/ipc_socket_factory.cc +++ b/content/renderer/p2p/ipc_socket_factory.cc @@ -19,6 +19,11 @@ namespace content { namespace { +bool IsTcpClientSocket(P2PSocketType type) { + return (type == P2P_SOCKET_STUN_TCP_CLIENT) || + (type == P2P_SOCKET_TCP_CLIENT); +} + // TODO(miu): This needs tuning. http://crbug.com/237960 const size_t kMaximumInFlightBytes = 64 * 1024; // 64 KB @@ -75,7 +80,6 @@ class IpcPacketSocket : public talk_base::AsyncPacketSocket, void InitAcceptedTcp(P2PSocketClient* client, const talk_base::SocketAddress& local_address, const talk_base::SocketAddress& remote_address); - P2PSocketType type_; // Message loop on which this socket was created and being used. @@ -267,7 +271,7 @@ talk_base::AsyncPacketSocket::State IpcPacketSocket::GetState() const { return STATE_BINDING; case IS_OPEN: - if (type_ == P2P_SOCKET_TCP_CLIENT) { + if (IsTcpClientSocket(type_)) { return STATE_CONNECTED; } else { return STATE_BOUND; @@ -316,7 +320,7 @@ void IpcPacketSocket::OnOpen(const net::IPEndPoint& address) { TraceSendThrottlingState(); SignalAddressReady(this, local_address_); - if (type_ == P2P_SOCKET_TCP_CLIENT) + if (IsTcpClientSocket(type_)) SignalConnect(this); } -- cgit v1.1