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

Unified Diff: content/renderer/media/webrtc/peer_connection_dependency_factory.cc

Issue 445933005: Support multiple STUN servers for PeerConnection. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | content/renderer/p2p/port_allocator.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/media/webrtc/peer_connection_dependency_factory.cc
diff --git a/content/renderer/media/webrtc/peer_connection_dependency_factory.cc b/content/renderer/media/webrtc/peer_connection_dependency_factory.cc
index 9b4fcdbb0d0049a737bd4788e4a4df9d4d5c5596..f5c98179338e2ac6b0cf05f9880916e03c964428 100644
--- a/content/renderer/media/webrtc/peer_connection_dependency_factory.cc
+++ b/content/renderer/media/webrtc/peer_connection_dependency_factory.cc
@@ -129,9 +129,10 @@ class P2PPortAllocatorFactory : public webrtc::PortAllocatorFactoryInterface {
const std::vector<TurnConfiguration>& turn_configurations) OVERRIDE {
CHECK(web_frame_);
P2PPortAllocator::Config config;
- if (stun_servers.size() > 0) {
- config.stun_server = stun_servers[0].server.hostname();
- config.stun_server_port = stun_servers[0].server.port();
+ for (size_t i = 0; i < stun_servers.size(); ++i) {
+ config.stun_servers.insert(rtc::SocketAddress(
+ stun_servers[i].server.hostname(),
+ stun_servers[i].server.port()));
}
config.legacy_relay = false;
for (size_t i = 0; i < turn_configurations.size(); ++i) {
@@ -143,12 +144,11 @@ class P2PPortAllocatorFactory : public webrtc::PortAllocatorFactoryInterface {
relay_config.transport_type = turn_configurations[i].transport_type;
relay_config.secure = turn_configurations[i].secure;
config.relays.push_back(relay_config);
- }
- // Use first turn server as the stun server.
- if (turn_configurations.size() > 0) {
- config.stun_server = config.relays[0].server_address;
- config.stun_server_port = config.relays[0].port;
+ // Use turn servers as stun servers.
+ config.stun_servers.insert(rtc::SocketAddress(
+ turn_configurations[i].server.hostname(),
+ turn_configurations[i].server.port()));
}
return new P2PPortAllocator(
« no previous file with comments | « no previous file | content/renderer/p2p/port_allocator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698