Index: webrtc/p2p/base/port.h |
diff --git a/webrtc/p2p/base/port.h b/webrtc/p2p/base/port.h |
index 6b1a551963d06a375f5368218d1b200f4d1d9fec..267d8bb418662a3a2855fab6776cc5ed665d976b 100644 |
--- a/webrtc/p2p/base/port.h |
+++ b/webrtc/p2p/base/port.h |
@@ -92,6 +92,15 @@ enum IcePriorityValue { |
ICE_TYPE_PREFERENCE_HOST = 126 |
}; |
+// States are from RFC 5245. http://tools.ietf.org/html/rfc5245#section-5.7.4 |
+enum class IceCandidatePairState { |
+ // TODO(hbos): Add and support the |FROZEN| state. |
Taylor Brandstetter
2016/12/23 18:59:45
For now, nothing is ever frozen, FYI. The Earth ma
hbos
2016/12/27 10:24:34
Ack. Updated the comment and removed the "TODO" bi
|
+ WAITING = 0, // Check has not been performed, Waiting pair on CL. |
+ IN_PROGRESS, // Check has been sent, transaction is in progress. |
+ SUCCEEDED, // Check already done, produced a successful result. |
+ FAILED, // Check for this connection failed. |
+}; |
+ |
const char* ProtoToString(ProtocolType proto); |
bool StringToProto(const char* value, ProtocolType* proto); |
@@ -419,14 +428,6 @@ class Connection : public CandidatePairInterface, |
uint32_t nomination; |
}; |
- // States are from RFC 5245. http://tools.ietf.org/html/rfc5245#section-5.7.4 |
- enum State { |
- STATE_WAITING = 0, // Check has not been performed, Waiting pair on CL. |
- STATE_INPROGRESS, // Check has been sent, transaction is in progress. |
- STATE_SUCCEEDED, // Check already done, produced a successful result. |
- STATE_FAILED // Check for this connection failed. |
- }; |
- |
virtual ~Connection(); |
// The local port where this connection sends and receives packets. |
@@ -467,7 +468,7 @@ class Connection : public CandidatePairInterface, |
// Estimate of the round-trip time over this connection. |
int rtt() const { return rtt_; } |
- ConnectionInfo stats(); |
+ ConnectionInfo stats(bool is_best_connection = false); |
sigslot::signal1<Connection*> SignalStateChange; |
@@ -575,7 +576,7 @@ class Connection : public CandidatePairInterface, |
// Invoked when Connection receives STUN error response with 487 code. |
void HandleRoleConflictFromPeer(); |
- State state() const { return state_; } |
+ IceCandidatePairState state() const { return state_; } |
int num_pings_sent() const { return num_pings_sent_; } |
@@ -630,7 +631,7 @@ class Connection : public CandidatePairInterface, |
// Changes the state and signals if necessary. |
void set_write_state(WriteState value); |
void UpdateReceiving(int64_t now); |
- void set_state(State state); |
+ void set_state(IceCandidatePairState state); |
void set_connected(bool value); |
uint32_t nomination() const { return nomination_; } |
@@ -686,7 +687,7 @@ class Connection : public CandidatePairInterface, |
std::vector<SentPing> pings_since_last_response_; |
bool reported_; |
- State state_; |
+ IceCandidatePairState state_; |
// Time duration to switch from receiving to not receiving. |
int receiving_timeout_; |
int64_t time_created_ms_; |