Index: webrtc/p2p/base/p2ptransportchannel.h |
diff --git a/webrtc/p2p/base/p2ptransportchannel.h b/webrtc/p2p/base/p2ptransportchannel.h |
index af761a65e7399b05362a76009b87637a1e628dc1..768f0ebf99de2bd65d8f8bde4b90ff5d1c4e8767 100644 |
--- a/webrtc/p2p/base/p2ptransportchannel.h |
+++ b/webrtc/p2p/base/p2ptransportchannel.h |
@@ -51,11 +51,11 @@ class RemoteCandidate : public Candidate { |
class P2PTransportChannel : public TransportChannelImpl, |
public rtc::MessageHandler { |
public: |
- P2PTransportChannel(const std::string& content_name, |
+ P2PTransportChannel(const std::string& transport_name, |
int component, |
P2PTransport* transport, |
- PortAllocator *allocator); |
- ~P2PTransportChannel() override; |
+ PortAllocator* allocator); |
+ virtual ~P2PTransportChannel(); |
// From TransportChannelImpl: |
Transport* GetTransport() override { return transport_; } |
@@ -69,15 +69,19 @@ class P2PTransportChannel : public TransportChannelImpl, |
const std::string& ice_pwd) override; |
void SetRemoteIceMode(IceMode mode) override; |
void Connect() override; |
- void OnSignalingReady() override; |
- void OnCandidate(const Candidate& candidate) override; |
+ IceGatheringState gathering_state() const override { |
+ return gathering_state_; |
+ } |
+ void AddRemoteCandidate(const Candidate& candidate) override; |
// Sets the receiving timeout in milliseconds. |
// This also sets the check_receiving_delay proportionally. |
void SetReceivingTimeout(int receiving_timeout_ms) override; |
// From TransportChannel: |
- int SendPacket(const char *data, size_t len, |
- const rtc::PacketOptions& options, int flags) override; |
+ int SendPacket(const char* data, |
+ size_t len, |
+ const rtc::PacketOptions& options, |
+ int flags) override; |
int SetOption(rtc::Socket::Option opt, int value) override; |
bool GetOption(rtc::Socket::Option opt, int* value) override; |
int GetError() override { return error_; } |
@@ -96,13 +100,9 @@ class P2PTransportChannel : public TransportChannelImpl, |
bool IsDtlsActive() const override { return false; } |
// Default implementation. |
- bool GetSslRole(rtc::SSLRole* role) const override { |
- return false; |
- } |
+ bool GetSslRole(rtc::SSLRole* role) const override { return false; } |
- bool SetSslRole(rtc::SSLRole role) override { |
- return false; |
- } |
+ bool SetSslRole(rtc::SSLRole role) override { return false; } |
// Set up the ciphers to use for DTLS-SRTP. |
bool SetSrtpCiphers(const std::vector<std::string>& ciphers) override { |
@@ -110,14 +110,10 @@ class P2PTransportChannel : public TransportChannelImpl, |
} |
// Find out which DTLS-SRTP cipher was negotiated. |
- bool GetSrtpCipher(std::string* cipher) override { |
- return false; |
- } |
+ bool GetSrtpCipher(std::string* cipher) override { return false; } |
// Find out which DTLS cipher was negotiated. |
- bool GetSslCipher(std::string* cipher) override { |
- return false; |
- } |
+ bool GetSslCipher(std::string* cipher) override { return false; } |
// Returns null because the channel is not encrypted by default. |
rtc::scoped_refptr<rtc::RTCCertificate> GetLocalCertificate() const override { |
@@ -165,7 +161,7 @@ class P2PTransportChannel : public TransportChannelImpl, |
return allocator_sessions_.back(); |
} |
- void Allocate(); |
+ void StartGatheringCandidates(); |
void UpdateConnectionStates(); |
void RequestSort(); |
void SortConnections(); |
@@ -212,7 +208,7 @@ class P2PTransportChannel : public TransportChannelImpl, |
void OnNominated(Connection* conn); |
- void OnMessage(rtc::Message *pmsg) override; |
+ void OnMessage(rtc::Message* pmsg) override; |
void OnSort(); |
void OnPing(); |
@@ -222,10 +218,9 @@ class P2PTransportChannel : public TransportChannelImpl, |
Connection* best_nominated_connection() const; |
P2PTransport* transport_; |
- PortAllocator *allocator_; |
- rtc::Thread *worker_thread_; |
+ PortAllocator* allocator_; |
+ rtc::Thread* worker_thread_; |
bool incoming_only_; |
- bool waiting_for_signaling_; |
int error_; |
std::vector<PortAllocatorSession*> allocator_sessions_; |
std::vector<PortInterface *> ports_; |
@@ -237,6 +232,7 @@ class P2PTransportChannel : public TransportChannelImpl, |
std::vector<RemoteCandidate> remote_candidates_; |
bool sort_dirty_; // indicates whether another sort is needed right now |
bool was_writable_; |
+ bool had_connection_ = false; // if connections_ has ever been nonempty |
typedef std::map<rtc::Socket::Option, int> OptionMap; |
OptionMap options_; |
std::string ice_ufrag_; |
@@ -247,6 +243,7 @@ class P2PTransportChannel : public TransportChannelImpl, |
IceRole ice_role_; |
uint64 tiebreaker_; |
uint32 remote_candidate_generation_; |
+ IceGatheringState gathering_state_; |
int check_receiving_delay_; |
int receiving_timeout_; |