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

Side by Side Diff: webrtc/p2p/client/basicportallocator.cc

Issue 1284113003: Move the concept of multiple route into Network (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Created 5 years, 4 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
« webrtc/base/network.h ('K') | « webrtc/base/network.h ('k') | no next file » | 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 289 matching lines...) Expand 10 before | Expand all | Expand 10 after
300 // For each network, see if we have a sequence that covers it already. If not, 300 // For each network, see if we have a sequence that covers it already. If not,
301 // create a new sequence to create the appropriate ports. 301 // create a new sequence to create the appropriate ports.
302 void BasicPortAllocatorSession::DoAllocate() { 302 void BasicPortAllocatorSession::DoAllocate() {
303 bool done_signal_needed = false; 303 bool done_signal_needed = false;
304 std::vector<rtc::Network*> networks; 304 std::vector<rtc::Network*> networks;
305 305
306 // If the adapter enumeration is disabled, we'll just bind to any address 306 // If the adapter enumeration is disabled, we'll just bind to any address
307 // instead of specific NIC. This is to ensure the same routing for http 307 // instead of specific NIC. This is to ensure the same routing for http
308 // traffic by OS is also used here to avoid any local or public IP leakage 308 // traffic by OS is also used here to avoid any local or public IP leakage
309 // during stun process. 309 // during stun process.
310 if (allocator_->network_manager()->adapter_enumeration_disabled()) {
juberti1 2015/08/13 20:45:58 It seems odd to set a flag based on some other con
guoweis_webrtc 2015/08/13 20:54:14 There are other places in the code which depends o
juberti1 2015/08/13 22:10:11 I see. In that case this seems like the best appro
311 set_flags(flags() | PORTALLOCATOR_DISABLE_ADAPTER_ENUMERATION);
312 }
313
310 if (flags() & PORTALLOCATOR_DISABLE_ADAPTER_ENUMERATION) { 314 if (flags() & PORTALLOCATOR_DISABLE_ADAPTER_ENUMERATION) {
311 allocator_->network_manager()->GetAnyAddressNetworks(&networks); 315 allocator_->network_manager()->GetAnyAddressNetworks(&networks);
312 } else { 316 } else {
313 allocator_->network_manager()->GetNetworks(&networks); 317 allocator_->network_manager()->GetNetworks(&networks);
314 } 318 }
315 if (networks.empty()) { 319 if (networks.empty()) {
316 LOG(LS_WARNING) << "Machine has no networks; no ports will be allocated"; 320 LOG(LS_WARNING) << "Machine has no networks; no ports will be allocated";
317 done_signal_needed = true; 321 done_signal_needed = true;
318 } else { 322 } else {
319 for (uint32 i = 0; i < networks.size(); ++i) { 323 for (uint32 i = 0; i < networks.size(); ++i) {
(...skipping 799 matching lines...) Expand 10 before | Expand all | Expand 10 after
1119 ServerAddresses servers; 1123 ServerAddresses servers;
1120 for (size_t i = 0; i < relays.size(); ++i) { 1124 for (size_t i = 0; i < relays.size(); ++i) {
1121 if (relays[i].type == turn_type && SupportsProtocol(relays[i], type)) { 1125 if (relays[i].type == turn_type && SupportsProtocol(relays[i], type)) {
1122 servers.insert(relays[i].ports.front().address); 1126 servers.insert(relays[i].ports.front().address);
1123 } 1127 }
1124 } 1128 }
1125 return servers; 1129 return servers;
1126 } 1130 }
1127 1131
1128 } // namespace cricket 1132 } // namespace cricket
OLDNEW
« webrtc/base/network.h ('K') | « webrtc/base/network.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698