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

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

Issue 1305113002: Clean up some code change (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
« no previous file with comments | « webrtc/p2p/base/turnport_unittest.cc ('k') | webrtc/p2p/client/portallocator_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 289 matching lines...) Expand 10 before | Expand all | Expand 10 after
300 300
301 // For each network, see if we have a sequence that covers it already. If not, 301 // For each network, see if we have a sequence that covers it already. If not,
302 // create a new sequence to create the appropriate ports. 302 // create a new sequence to create the appropriate ports.
303 void BasicPortAllocatorSession::DoAllocate() { 303 void BasicPortAllocatorSession::DoAllocate() {
304 bool done_signal_needed = false; 304 bool done_signal_needed = false;
305 std::vector<rtc::Network*> networks; 305 std::vector<rtc::Network*> networks;
306 306
307 // If the network permission state is BLOCKED, we just act as if the flag has 307 // If the network permission state is BLOCKED, we just act as if the flag has
308 // been passed in. 308 // been passed in.
309 if (allocator_->network_manager()->enumeration_permission() == 309 if (allocator_->network_manager()->enumeration_permission() ==
310 rtc::NetworkManager::kEnumerationDisallowed) { 310 rtc::NetworkManager::ENUMERATION_BLOCKED) {
311 set_flags(flags() | PORTALLOCATOR_DISABLE_ADAPTER_ENUMERATION); 311 set_flags(flags() | PORTALLOCATOR_DISABLE_ADAPTER_ENUMERATION);
312 } 312 }
313 313
314 // If the adapter enumeration is disabled, we'll just bind to any address 314 // If the adapter enumeration is disabled, we'll just bind to any address
315 // instead of specific NIC. This is to ensure the same routing for http 315 // instead of specific NIC. This is to ensure the same routing for http
316 // traffic by OS is also used here to avoid any local or public IP leakage 316 // traffic by OS is also used here to avoid any local or public IP leakage
317 // during stun process. 317 // during stun process.
318 if (flags() & PORTALLOCATOR_DISABLE_ADAPTER_ENUMERATION) { 318 if (flags() & PORTALLOCATOR_DISABLE_ADAPTER_ENUMERATION) {
319 allocator_->network_manager()->GetAnyAddressNetworks(&networks); 319 allocator_->network_manager()->GetAnyAddressNetworks(&networks);
320 } else { 320 } else {
(...skipping 812 matching lines...) Expand 10 before | Expand all | Expand 10 after
1133 ServerAddresses servers; 1133 ServerAddresses servers;
1134 for (size_t i = 0; i < relays.size(); ++i) { 1134 for (size_t i = 0; i < relays.size(); ++i) {
1135 if (relays[i].type == turn_type && SupportsProtocol(relays[i], type)) { 1135 if (relays[i].type == turn_type && SupportsProtocol(relays[i], type)) {
1136 servers.insert(relays[i].ports.front().address); 1136 servers.insert(relays[i].ports.front().address);
1137 } 1137 }
1138 } 1138 }
1139 return servers; 1139 return servers;
1140 } 1140 }
1141 1141
1142 } // namespace cricket 1142 } // namespace cricket
OLDNEW
« no previous file with comments | « webrtc/p2p/base/turnport_unittest.cc ('k') | webrtc/p2p/client/portallocator_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698