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

Unified Diff: webrtc/p2p/client/basicportallocator.cc

Issue 1414313003: Reland of Adding the ability to change ICE servers through SetConfiguration. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Adding "override" to applicable methods to fix compile warning. Created 5 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/p2p/client/basicportallocator.h ('k') | webrtc/p2p/client/fakeportallocator.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/p2p/client/basicportallocator.cc
diff --git a/webrtc/p2p/client/basicportallocator.cc b/webrtc/p2p/client/basicportallocator.cc
index 21c8921f4024c51b3679471595a97dae199c1625..5d3397bf9166be5dca86bf9741e1a740865caeef 100644
--- a/webrtc/p2p/client/basicportallocator.cc
+++ b/webrtc/p2p/client/basicportallocator.cc
@@ -104,15 +104,19 @@ BasicPortAllocator::BasicPortAllocator(
stun_servers_(stun_servers) {
RelayServerConfig config(RELAY_GTURN);
- if (!relay_address_udp.IsNil())
+ if (!relay_address_udp.IsNil()) {
config.ports.push_back(ProtocolAddress(relay_address_udp, PROTO_UDP));
- if (!relay_address_tcp.IsNil())
+ }
+ if (!relay_address_tcp.IsNil()) {
config.ports.push_back(ProtocolAddress(relay_address_tcp, PROTO_TCP));
- if (!relay_address_ssl.IsNil())
+ }
+ if (!relay_address_ssl.IsNil()) {
config.ports.push_back(ProtocolAddress(relay_address_ssl, PROTO_SSLTCP));
+ }
- if (!config.ports.empty())
- AddRelay(config);
+ if (!config.ports.empty()) {
+ AddTurnServer(config);
+ }
Construct();
}
@@ -241,8 +245,8 @@ void BasicPortAllocatorSession::GetPortConfigurations() {
username(),
password());
- for (size_t i = 0; i < allocator_->relays().size(); ++i) {
- config->AddRelay(allocator_->relays()[i]);
+ for (const RelayServerConfig& turn_server : allocator_->turn_servers()) {
+ config->AddRelay(turn_server);
}
ConfigReady(config);
}
@@ -253,8 +257,9 @@ void BasicPortAllocatorSession::ConfigReady(PortConfiguration* config) {
// Adds a configuration to the list.
void BasicPortAllocatorSession::OnConfigReady(PortConfiguration* config) {
- if (config)
+ if (config) {
configs_.push_back(config);
+ }
AllocatePorts();
}
« no previous file with comments | « webrtc/p2p/client/basicportallocator.h ('k') | webrtc/p2p/client/fakeportallocator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698