Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(335)

Side by Side Diff: content/browser/renderer_host/p2p/socket_host_tcp_server.cc

Issue 17132012: Proxy support for P2P TCP Socket (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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_server.h" 5 #include "content/browser/renderer_host/p2p/socket_host_tcp_server.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/stl_util.h" 9 #include "base/stl_util.h"
10 #include "content/browser/renderer_host/p2p/socket_host_tcp.h" 10 #include "content/browser/renderer_host/p2p/socket_host_tcp.h"
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 const net::IPEndPoint& remote_address, int id) { 124 const net::IPEndPoint& remote_address, int id) {
125 AcceptedSocketsMap::iterator it = accepted_sockets_.find(remote_address); 125 AcceptedSocketsMap::iterator it = accepted_sockets_.find(remote_address);
126 if (it == accepted_sockets_.end()) 126 if (it == accepted_sockets_.end())
127 return NULL; 127 return NULL;
128 128
129 net::StreamSocket* socket = it->second; 129 net::StreamSocket* socket = it->second;
130 accepted_sockets_.erase(it); 130 accepted_sockets_.erase(it);
131 131
132 scoped_ptr<P2PSocketHostTcpBase> result; 132 scoped_ptr<P2PSocketHostTcpBase> result;
133 if (client_type_ == P2P_SOCKET_TCP_CLIENT) { 133 if (client_type_ == P2P_SOCKET_TCP_CLIENT) {
134 result.reset(new P2PSocketHostTcp(message_sender_, id, client_type_)); 134 result.reset(new P2PSocketHostTcp(message_sender_, id, client_type_, NULL));
135 } else { 135 } else {
136 result.reset(new P2PSocketHostStunTcp(message_sender_, id, client_type_)); 136 result.reset(new P2PSocketHostStunTcp(
137 message_sender_, id, client_type_, NULL));
137 } 138 }
138 if (!result->InitAccepted(remote_address, socket)) 139 if (!result->InitAccepted(remote_address, socket))
139 return NULL; 140 return NULL;
140 return result.release(); 141 return result.release();
141 } 142 }
142 143
143 } // namespace content 144 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/renderer_host/p2p/socket_host_tcp.cc ('k') | content/browser/renderer_host/p2p/socket_host_tcp_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698