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

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: Fixing patch conflict. 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/base/portallocator.h ('k') | webrtc/p2p/client/basicportallocator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/p2p/client/basicportallocator.h
diff --git a/webrtc/p2p/client/basicportallocator.h b/webrtc/p2p/client/basicportallocator.h
index c8bcad21a9d36e2b620a2d418f58bf189815983f..35cb37ecd4b3f6ff834df770c216b4774708eeb4 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 {
+ stun_servers_ = stun_servers;
+ turn_servers_ = turn_servers;
+ }
+
rtc::NetworkManager* network_manager() { return network_manager_; }
// If socket_factory() is set to NULL each PortAllocatorSession
@@ -70,11 +54,11 @@ class BasicPortAllocator : public PortAllocator {
return stun_servers_;
}
- const std::vector<RelayServerConfig>& relays() const {
- return relays_;
+ const std::vector<RelayServerConfig>& turn_servers() const {
+ return turn_servers_;
}
- virtual void AddRelay(const RelayServerConfig& relay) {
- relays_.push_back(relay);
+ virtual void AddTurnServer(const RelayServerConfig& turn_server) {
+ turn_servers_.push_back(turn_server);
}
virtual PortAllocatorSession* CreateSessionInternal(
@@ -88,8 +72,8 @@ class BasicPortAllocator : public PortAllocator {
rtc::NetworkManager* network_manager_;
rtc::PacketSocketFactory* socket_factory_;
- const ServerAddresses stun_servers_;
- std::vector<RelayServerConfig> relays_;
+ ServerAddresses stun_servers_;
+ std::vector<RelayServerConfig> turn_servers_;
bool allow_tcp_listen_;
};
@@ -204,6 +188,7 @@ class BasicPortAllocatorSession : public PortAllocatorSession,
};
// Records configuration information useful in creating ports.
+// TODO(deadbeef): Rename "relay" to "turn_server" in this struct.
struct PortConfiguration : public rtc::MessageData {
// TODO(jiayl): remove |stun_address| when Chrome is updated.
rtc::SocketAddress stun_address;
« no previous file with comments | « webrtc/p2p/base/portallocator.h ('k') | webrtc/p2p/client/basicportallocator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698