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

Side by Side Diff: webrtc/base/natsocketfactory.cc

Issue 2883313003: Remove VirtualSocketServer's dependency on PhysicalSocketServer. (Closed)
Patch Set: Created 3 years, 7 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
« no previous file with comments | « webrtc/base/nat_unittest.cc ('k') | webrtc/base/proxy_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. 2 * Copyright 2004 The WebRTC Project Authors. All rights reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after
407 } 407 }
408 408
409 // NATSocketServer::Translator 409 // NATSocketServer::Translator
410 NATSocketServer::Translator::Translator( 410 NATSocketServer::Translator::Translator(
411 NATSocketServer* server, NATType type, const SocketAddress& int_ip, 411 NATSocketServer* server, NATType type, const SocketAddress& int_ip,
412 SocketFactory* ext_factory, const SocketAddress& ext_ip) 412 SocketFactory* ext_factory, const SocketAddress& ext_ip)
413 : server_(server) { 413 : server_(server) {
414 // Create a new private network, and a NATServer running on the private 414 // Create a new private network, and a NATServer running on the private
415 // network that bridges to the external network. Also tell the private 415 // network that bridges to the external network. Also tell the private
416 // network to use the same message queue as us. 416 // network to use the same message queue as us.
417 VirtualSocketServer* internal_server = new VirtualSocketServer(server_); 417 VirtualSocketServer* internal_server = new VirtualSocketServer();
418 internal_server->SetMessageQueue(server_->queue()); 418 internal_server->SetMessageQueue(server_->queue());
419 internal_factory_.reset(internal_server); 419 internal_factory_.reset(internal_server);
420 nat_server_.reset(new NATServer(type, internal_server, int_ip, int_ip, 420 nat_server_.reset(new NATServer(type, internal_server, int_ip, int_ip,
421 ext_factory, ext_ip)); 421 ext_factory, ext_ip));
422 } 422 }
423 423
424 NATSocketServer::Translator::~Translator() = default; 424 NATSocketServer::Translator::~Translator() = default;
425 425
426 NATSocketServer::Translator* NATSocketServer::Translator::GetTranslator( 426 NATSocketServer::Translator* NATSocketServer::Translator::GetTranslator(
427 const SocketAddress& ext_ip) { 427 const SocketAddress& ext_ip) {
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
500 NATSocketServer::Translator* NATSocketServer::TranslatorMap::FindClient( 500 NATSocketServer::Translator* NATSocketServer::TranslatorMap::FindClient(
501 const SocketAddress& int_ip) { 501 const SocketAddress& int_ip) {
502 Translator* nat = nullptr; 502 Translator* nat = nullptr;
503 for (TranslatorMap::iterator it = begin(); it != end() && !nat; ++it) { 503 for (TranslatorMap::iterator it = begin(); it != end() && !nat; ++it) {
504 nat = it->second->FindClient(int_ip); 504 nat = it->second->FindClient(int_ip);
505 } 505 }
506 return nat; 506 return nat;
507 } 507 }
508 508
509 } // namespace rtc 509 } // namespace rtc
OLDNEW
« no previous file with comments | « webrtc/base/nat_unittest.cc ('k') | webrtc/base/proxy_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698