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

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

Issue 1956453003: Relanding: Implement RTCConfiguration.iceCandidatePoolSize. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Fixing uninitialized variable (noticed by msan) 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 c66ae596c8a282400d7c0078fba33c84dcb584cb..ec1fcb54f8747f41645e80dadec077faec6cd401 100644
--- a/webrtc/p2p/client/basicportallocator.h
+++ b/webrtc/p2p/client/basicportallocator.h
@@ -38,13 +38,6 @@ 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;
- }
-
// Set to kDefaultNetworkIgnoreMask by default.
void SetNetworkIgnoreMask(int network_ignore_mask) override {
// TODO(phoglund): implement support for other types than loopback.
@@ -61,30 +54,20 @@ class BasicPortAllocator : public PortAllocator {
// 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;
};
@@ -110,8 +93,14 @@ class BasicPortAllocatorSession : public PortAllocatorSession,
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();
@@ -130,13 +119,11 @@ class BasicPortAllocatorSession : public PortAllocatorSession,
: port_(port), sequence_(seq), state_(STATE_INIT) {
}
- Port* port() { return port_; }
- AllocationSequence* sequence() { return sequence_; }
+ Port* port() const { return port_; }
+ AllocationSequence* sequence() const { return sequence_; }
bool ready() const { return state_ == STATE_READY; }
- bool complete() const {
- // Returns true if candidate allocation has completed one way or another.
- return ((state_ == STATE_COMPLETE) || (state_ == STATE_ERROR));
- }
+ bool complete() const { return state_ == STATE_COMPLETE; }
+ bool error() const { return state_ == STATE_ERROR; }
void set_ready() { ASSERT(state_ == STATE_INIT); state_ = STATE_READY; }
void set_complete() {
@@ -182,7 +169,7 @@ class BasicPortAllocatorSession : public PortAllocatorSession,
PortData* FindPort(Port* port);
void GetNetworks(std::vector<rtc::Network*>* networks);
- bool CheckCandidateFilter(const Candidate& c);
+ bool CheckCandidateFilter(const Candidate& c) const;
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