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

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

Issue 1391013007: Adding the ability to change ICE servers through SetConfiguration. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: 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
Index: webrtc/p2p/client/basicportallocator.h
diff --git a/webrtc/p2p/client/basicportallocator.h b/webrtc/p2p/client/basicportallocator.h
index c8bcad21a9d36e2b620a2d418f58bf189815983f..d0c59a9bd39d100e5a065d344fa7289afece2a51 100644
--- a/webrtc/p2p/client/basicportallocator.h
+++ b/webrtc/p2p/client/basicportallocator.h
@@ -14,7 +14,6 @@
#include <string>
#include <vector>
-#include "webrtc/p2p/base/port.h"
#include "webrtc/p2p/base/portallocator.h"
#include "webrtc/base/messagequeue.h"
#include "webrtc/base/network.h"
@@ -23,28 +22,6 @@
namespace cricket {
-struct RelayCredentials {
- RelayCredentials() {}
- RelayCredentials(const std::string& username,
- const std::string& password)
- : username(username),
- password(password) {
- }
-
- std::string username;
- std::string password;
-};
-
-typedef std::vector<ProtocolAddress> PortList;
-struct RelayServerConfig {
- RelayServerConfig(RelayType type) : type(type), priority(0) {}
-
- RelayType type;
- PortList ports;
- RelayCredentials credentials;
- int priority;
-};
-
class BasicPortAllocator : public PortAllocator {
public:
BasicPortAllocator(rtc::NetworkManager* network_manager,
@@ -60,6 +37,13 @@ class BasicPortAllocator : public PortAllocator {
const rtc::SocketAddress& relay_server_ssl);
virtual ~BasicPortAllocator();
+ void SetIceServers(
+ const ServerAddresses& stun_servers,
+ const std::vector<RelayServerConfig>& turn_servers) override {
pthatcher1 2015/10/20 18:31:27 relay_servers
+ stun_servers_ = stun_servers;
+ relays_ = turn_servers;
+ }
+
rtc::NetworkManager* network_manager() { return network_manager_; }
// If socket_factory() is set to NULL each PortAllocatorSession
@@ -88,7 +72,7 @@ class BasicPortAllocator : public PortAllocator {
rtc::NetworkManager* network_manager_;
rtc::PacketSocketFactory* socket_factory_;
- const ServerAddresses stun_servers_;
+ ServerAddresses stun_servers_;
std::vector<RelayServerConfig> relays_;
pthatcher1 2015/10/20 18:31:26 relay_servers_
bool allow_tcp_listen_;
};

Powered by Google App Engine
This is Rietveld 408576698