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

Unified Diff: webrtc/p2p/base/port.h

Issue 2163403002: Prepare for ICE-renomination (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Updated comments Created 4 years, 4 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/p2ptransportchannel_unittest.cc ('k') | webrtc/p2p/base/port.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/p2p/base/port.h
diff --git a/webrtc/p2p/base/port.h b/webrtc/p2p/base/port.h
index 081e81af1d0c32db9a88510181745dd4ce18b673..d5ad65f08100efb9d55cce2ff5e62c17579a284d 100644
--- a/webrtc/p2p/base/port.h
+++ b/webrtc/p2p/base/port.h
@@ -417,11 +417,12 @@ class Connection : public CandidatePairInterface,
public sigslot::has_slots<> {
public:
struct SentPing {
- SentPing(const std::string id, int64_t sent_time)
- : id(id), sent_time(sent_time) {}
+ SentPing(const std::string id, int64_t sent_time, uint32_t nomination)
+ : id(id), sent_time(sent_time), nomination(nomination) {}
std::string id;
int64_t sent_time;
+ uint32_t nomination;
};
// States are from RFC 5245. http://tools.ietf.org/html/rfc5245#section-5.7.4
@@ -511,8 +512,16 @@ class Connection : public CandidatePairInterface,
bool use_candidate_attr() const { return use_candidate_attr_; }
void set_use_candidate_attr(bool enable);
- bool nominated() const { return nominated_; }
- void set_nominated(bool nominated) { nominated_ = nominated; }
+ void set_nomination(uint32_t value) { nomination_ = value; }
+
+ uint32_t remote_nomination() const { return remote_nomination_; }
+ bool nominated() const { return remote_nomination_ > 0; }
+ // Public for unit tests.
+ void set_remote_nomination(uint32_t remote_nomination) {
+ remote_nomination_ = remote_nomination;
+ }
+ // Public for unit tests.
+ uint32_t acked_nomination() const { return acked_nomination_; }
void set_remote_ice_mode(IceMode mode) {
remote_ice_mode_ = mode;
@@ -539,7 +548,7 @@ class Connection : public CandidatePairInterface,
// Called when this connection should try checking writability again.
int64_t last_ping_sent() const { return last_ping_sent_; }
void Ping(int64_t now);
- void ReceivedPingResponse(int rtt);
+ void ReceivedPingResponse(int rtt, const std::string& request_id);
int64_t last_ping_response_received() const {
return last_ping_response_received_;
}
@@ -631,11 +640,19 @@ class Connection : public CandidatePairInterface,
void set_state(State state);
void set_connected(bool value);
+ uint32_t nomination() const { return nomination_; }
+
void OnMessage(rtc::Message *pmsg);
Port* port_;
size_t local_candidate_index_;
Candidate remote_candidate_;
+
+ ConnectionInfo stats_;
+ rtc::RateTracker recv_rate_tracker_;
+ rtc::RateTracker send_rate_tracker_;
+
+ private:
WriteState write_state_;
bool receiving_;
bool connected_;
@@ -645,9 +662,19 @@ class Connection : public CandidatePairInterface,
// But when peer is ice-lite, this flag "must" be initialized to false and
// turn on when connection becomes "best connection".
bool use_candidate_attr_;
- // Whether this connection has been nominated by the controlling side via
- // the use_candidate attribute.
- bool nominated_;
+ // Used by the controlling side to indicate that this connection will be
+ // selected for transmission if the peer supports ICE-renomination when this
+ // value is positive. A larger-value indicates that a connection is nominated
+ // later and should be selected by the controlled side with higher precedence.
+ // A zero-value indicates not nominating this connection.
+ uint32_t nomination_ = 0;
+ // The last nomination that has been acknowledged.
+ uint32_t acked_nomination_ = 0;
+ // Used by the controlled side to remember the nomination value received from
+ // the controlling side. When the peer does not support ICE re-nomination,
+ // its value will be 1 if the connection has been nominated.
+ uint32_t remote_nomination_ = 0;
+
IceMode remote_ice_mode_;
StunRequestManager requests_;
int rtt_;
@@ -660,12 +687,6 @@ class Connection : public CandidatePairInterface,
int64_t receiving_unchanged_since_ = 0;
std::vector<SentPing> pings_since_last_response_;
- rtc::RateTracker recv_rate_tracker_;
- rtc::RateTracker send_rate_tracker_;
-
- ConnectionInfo stats_;
-
- private:
void MaybeAddPrflxCandidate(ConnectionRequest* request,
StunMessage* response);
« no previous file with comments | « webrtc/p2p/base/p2ptransportchannel_unittest.cc ('k') | webrtc/p2p/base/port.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698