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

Unified Diff: remoting/client/plugin/pepper_port_allocator.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 | « content/renderer/p2p/port_allocator.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/client/plugin/pepper_port_allocator.cc
diff --git a/remoting/client/plugin/pepper_port_allocator.cc b/remoting/client/plugin/pepper_port_allocator.cc
index 5cceee1b9a2aa890a296310d0120fc37b78cdf4c..87f4bf4658c42bbdf3a070efd6a5d62a449f70ac 100644
--- a/remoting/client/plugin/pepper_port_allocator.cc
+++ b/remoting/client/plugin/pepper_port_allocator.cc
@@ -103,14 +103,13 @@ PepperPortAllocatorSession::~PepperPortAllocatorSession() {
void PepperPortAllocatorSession::ConfigReady(
cricket::PortConfiguration* config) {
- if (config->stun_address.IsUnresolved()) {
+ if (!config->stun_servers.empty() &&
Sergey Ulanov 2014/08/08 19:57:16 FYI: there is https://codereview.chromium.org/4529
+ config->stun_servers.begin()->IsUnresolved()) {
// Make sure that the address that we pass to ConfigReady() is
// always resolved.
- if (stun_address_.IsUnresolved()) {
- config->stun_address.Clear();
- } else {
- config->stun_address = stun_address_;
- }
+ config->stun_servers.clear();
+ if (!stun_address_.IsUnresolved())
+ config->stun_servers.insert(stun_address_);
}
// Filter out non-UDP relay ports, so that we don't try using TCP.
@@ -132,7 +131,7 @@ void PepperPortAllocatorSession::GetPortConfigurations() {
// Add an empty configuration synchronously, so a local connection
// can be started immediately.
ConfigReady(new cricket::PortConfiguration(
- rtc::SocketAddress(), std::string(), std::string()));
+ cricket::ServerAddresses(), std::string(), std::string()));
ResolveStunServerAddress();
TryCreateRelaySession();
@@ -198,8 +197,10 @@ void PepperPortAllocatorSession::OnStunAddressResolved(int32_t result) {
ReceiveSessionResponse(std::string(relay_response_body_.begin(),
relay_response_body_.end()));
} else {
+ cricket::ServerAddresses stun;
+ stun.insert(stun_address_);
ConfigReady(new cricket::PortConfiguration(
- stun_address_, std::string(), std::string()));
+ stun, std::string(), std::string()));
}
}
« no previous file with comments | « content/renderer/p2p/port_allocator.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698