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

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

Issue 2719523002: RTCIceCandidatePairStats.[total/current]RoundTripTime collected. (Closed)
Patch Set: EXPECT_EQ(expected, actual) Created 3 years, 10 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/port.h ('k') | webrtc/p2p/base/port_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/p2p/base/port.cc
diff --git a/webrtc/p2p/base/port.cc b/webrtc/p2p/base/port.cc
index 80b09c5034f313a6d850b0318132a2bee5a6edf5..7410b20bf4c20bf53694175742c0c4dab4de96d2 100644
--- a/webrtc/p2p/base/port.cc
+++ b/webrtc/p2p/base/port.cc
@@ -1251,6 +1251,7 @@ void Connection::ReceivedPing() {
}
void Connection::ReceivedPingResponse(int rtt, const std::string& request_id) {
+ RTC_DCHECK_GE(rtt, 0);
// We've already validated that this is a STUN binding response with
// the correct local and remote username for this connection.
// So if we're not already, become writable. We may be bringing a pruned
@@ -1264,6 +1265,10 @@ void Connection::ReceivedPingResponse(int rtt, const std::string& request_id) {
acked_nomination_ = iter->nomination;
}
+ total_round_trip_time_ms_ += rtt;
+ current_round_trip_time_ms_ = rtc::Optional<uint32_t>(
+ static_cast<uint32_t>(rtt));
+
pings_since_last_response_.clear();
last_ping_response_received_ = rtc::TimeMillis();
UpdateReceiving(last_ping_response_received_);
@@ -1504,6 +1509,8 @@ ConnectionInfo Connection::stats() {
stats_.state = state_;
stats_.priority = priority();
stats_.nominated = nominated();
+ stats_.total_round_trip_time_ms = total_round_trip_time_ms_;
+ stats_.current_round_trip_time_ms = current_round_trip_time_ms_;
return stats_;
}
« no previous file with comments | « webrtc/p2p/base/port.h ('k') | webrtc/p2p/base/port_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698