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

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

Issue 1982513002: Revert of Relanding: Implement RTCConfiguration.iceCandidatePoolSize. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 7 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/transportcontroller_unittest.cc ('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 ec1fcb54f8747f41645e80dadec077faec6cd401..c66ae596c8a282400d7c0078fba33c84dcb584cb 100644
--- a/webrtc/p2p/client/basicportallocator.h
+++ b/webrtc/p2p/client/basicportallocator.h
@@ -38,6 +38,13 @@
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;
+ }
+
// Set to kDefaultNetworkIgnoreMask by default.
void SetNetworkIgnoreMask(int network_ignore_mask) override {
// TODO(phoglund): implement support for other types than loopback.
@@ -54,20 +61,30 @@
// creates its own socket factory.
rtc::PacketSocketFactory* socket_factory() { return socket_factory_; }
+ const ServerAddresses& stun_servers() const {
+ return stun_servers_;
+ }
+
+ const std::vector<RelayServerConfig>& turn_servers() const {
+ return turn_servers_;
+ }
+ virtual void AddTurnServer(const RelayServerConfig& turn_server) {
+ turn_servers_.push_back(turn_server);
+ }
+
PortAllocatorSession* CreateSessionInternal(
const std::string& content_name,
int component,
const std::string& ice_ufrag,
const std::string& ice_pwd) override;
- // Convenience method that adds a TURN server to the configuration.
- void AddTurnServer(const RelayServerConfig& turn_server);
-
private:
void Construct();
rtc::NetworkManager* network_manager_;
rtc::PacketSocketFactory* socket_factory_;
+ ServerAddresses stun_servers_;
+ std::vector<RelayServerConfig> turn_servers_;
bool allow_tcp_listen_;
int network_ignore_mask_ = rtc::kDefaultNetworkIgnoreMask;
};
@@ -93,14 +110,8 @@
void StopGettingPorts() override;
void ClearGettingPorts() override;
bool IsGettingPorts() override { return running_; }
- // These will all be cricket::Ports.
- std::vector<PortInterface*> ReadyPorts() const override;
- std::vector<Candidate> ReadyCandidates() const override;
- bool CandidatesAllocationDone() const override;
protected:
- void UpdateIceParametersInternal() override;
-
// Starts the process of getting the port configurations.
virtual void GetPortConfigurations();
@@ -119,11 +130,13 @@
: port_(port), sequence_(seq), state_(STATE_INIT) {
}
- Port* port() const { return port_; }
- AllocationSequence* sequence() const { return sequence_; }
+ Port* port() { return port_; }
+ AllocationSequence* sequence() { return sequence_; }
bool ready() const { return state_ == STATE_READY; }
- bool complete() const { return state_ == STATE_COMPLETE; }
- bool error() const { return state_ == STATE_ERROR; }
+ bool complete() const {
+ // Returns true if candidate allocation has completed one way or another.
+ return ((state_ == STATE_COMPLETE) || (state_ == STATE_ERROR));
+ }
void set_ready() { ASSERT(state_ == STATE_INIT); state_ = STATE_READY; }
void set_complete() {
@@ -169,7 +182,7 @@
PortData* FindPort(Port* port);
void GetNetworks(std::vector<rtc::Network*>* networks);
- bool CheckCandidateFilter(const Candidate& c) const;
+ bool CheckCandidateFilter(const Candidate& c);
BasicPortAllocator* allocator_;
rtc::Thread* network_thread_;
« no previous file with comments | « webrtc/p2p/base/transportcontroller_unittest.cc ('k') | webrtc/p2p/client/basicportallocator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698