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

Side by Side Diff: webrtc/api/peerconnection.cc

Issue 2093623004: Add config to prune TURN ports (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Add all tests and fix a bug to set port type Created 4 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
OLDNEW
1 /* 1 /*
2 * Copyright 2012 The WebRTC project authors. All Rights Reserved. 2 * Copyright 2012 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 2154 matching lines...) Expand 10 before | Expand all | Expand 10 after
2165 } 2165 }
2166 2166
2167 port_allocator_->set_flags(portallocator_flags); 2167 port_allocator_->set_flags(portallocator_flags);
2168 // No step delay is used while allocating ports. 2168 // No step delay is used while allocating ports.
2169 port_allocator_->set_step_delay(cricket::kMinimumStepDelay); 2169 port_allocator_->set_step_delay(cricket::kMinimumStepDelay);
2170 port_allocator_->set_candidate_filter( 2170 port_allocator_->set_candidate_filter(
2171 ConvertIceTransportTypeToCandidateFilter(configuration.type)); 2171 ConvertIceTransportTypeToCandidateFilter(configuration.type));
2172 2172
2173 // Call this last since it may create pooled allocator sessions using the 2173 // Call this last since it may create pooled allocator sessions using the
2174 // properties set above. 2174 // properties set above.
2175 port_allocator_->SetConfiguration(stun_servers, turn_servers, 2175 port_allocator_->SetConfiguration(
2176 configuration.ice_candidate_pool_size); 2176 stun_servers, turn_servers, configuration.ice_candidate_pool_size,
2177 configuration.disable_low_priority_turn_ports);
2177 return true; 2178 return true;
2178 } 2179 }
2179 2180
2180 bool PeerConnection::ReconfigurePortAllocator_n( 2181 bool PeerConnection::ReconfigurePortAllocator_n(
2181 const RTCConfiguration& configuration) { 2182 const RTCConfiguration& configuration) {
2182 cricket::ServerAddresses stun_servers; 2183 cricket::ServerAddresses stun_servers;
2183 std::vector<cricket::RelayServerConfig> turn_servers; 2184 std::vector<cricket::RelayServerConfig> turn_servers;
2184 if (!ParseIceServers(configuration.servers, &stun_servers, &turn_servers)) { 2185 if (!ParseIceServers(configuration.servers, &stun_servers, &turn_servers)) {
2185 return false; 2186 return false;
2186 } 2187 }
2187 port_allocator_->set_candidate_filter( 2188 port_allocator_->set_candidate_filter(
2188 ConvertIceTransportTypeToCandidateFilter(configuration.type)); 2189 ConvertIceTransportTypeToCandidateFilter(configuration.type));
2189 // Call this last since it may create pooled allocator sessions using the 2190 // Call this last since it may create pooled allocator sessions using the
2190 // candidate filter set above. 2191 // candidate filter set above.
2191 port_allocator_->SetConfiguration(stun_servers, turn_servers, 2192 port_allocator_->SetConfiguration(
2192 configuration.ice_candidate_pool_size); 2193 stun_servers, turn_servers, configuration.ice_candidate_pool_size,
2194 configuration.disable_low_priority_turn_ports);
2193 return true; 2195 return true;
2194 } 2196 }
2195 2197
2196 } // namespace webrtc 2198 } // namespace webrtc
OLDNEW
« no previous file with comments | « no previous file | webrtc/api/peerconnectioninterface.h » ('j') | webrtc/p2p/base/p2ptransportchannel.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698