Index: webrtc/p2p/base/p2ptransportchannel.h |
diff --git a/webrtc/p2p/base/p2ptransportchannel.h b/webrtc/p2p/base/p2ptransportchannel.h |
index a8f16666c9625897de4cff8e9f0e11a86c76d13e..92969c8b7e0436b798af444bb229ce678809a30e 100644 |
--- a/webrtc/p2p/base/p2ptransportchannel.h |
+++ b/webrtc/p2p/base/p2ptransportchannel.h |
@@ -51,11 +51,11 @@ |
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,20 @@ |
const std::string& ice_pwd) override; |
void SetRemoteIceMode(IceMode mode) override; |
void Connect() override; |
- void OnSignalingReady() override; |
- void OnCandidate(const Candidate& candidate) override; |
+ void MaybeStartGathering() 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 +101,9 @@ |
bool IsDtlsActive() const override { return false; } |
// Default implementation. |
- bool GetSslRole(rtc::SSLRole* role) const override { |
- return false; |
- } |
- |
- bool SetSslRole(rtc::SSLRole role) override { |
- return false; |
- } |
+ bool GetSslRole(rtc::SSLRole* role) const 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 +111,10 @@ |
} |
// 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 +162,6 @@ |
return allocator_sessions_.back(); |
} |
- void Allocate(); |
void UpdateConnectionStates(); |
void RequestSort(); |
void SortConnections(); |
@@ -213,7 +209,7 @@ |
void OnNominated(Connection* conn); |
- void OnMessage(rtc::Message *pmsg) override; |
+ void OnMessage(rtc::Message* pmsg) override; |
void OnSort(); |
void OnPing(); |
@@ -223,10 +219,9 @@ |
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_; |
@@ -238,6 +233,7 @@ |
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_; |
@@ -248,6 +244,7 @@ |
IceRole ice_role_; |
uint64 tiebreaker_; |
uint32 remote_candidate_generation_; |
+ IceGatheringState gathering_state_; |
int check_receiving_delay_; |
int receiving_timeout_; |