Chromium Code Reviews| Index: net/quic/quic_connection_logger.cc |
| diff --git a/net/quic/quic_connection_logger.cc b/net/quic/quic_connection_logger.cc |
| index 9635102e867f74003024c04cc1ca967c634c2a80..4a67e8557cedf2c345121d47b6c6d1b7b4bc3fba 100644 |
| --- a/net/quic/quic_connection_logger.cc |
| +++ b/net/quic/quic_connection_logger.cc |
| @@ -22,6 +22,7 @@ |
| #include "net/quic/crypto/crypto_protocol.h" |
| #include "net/quic/quic_address_mismatch.h" |
| #include "net/quic/quic_socket_address_coder.h" |
| +#include "net/quic/quic_time.h" |
| using base::StringPiece; |
| using std::string; |
| @@ -286,6 +287,7 @@ AddressFamily GetRealAddressFamily(const IPAddressNumber& address) { |
| QuicConnectionLogger::QuicConnectionLogger( |
| QuicSpdySession* session, |
| const char* const connection_description, |
| + scoped_ptr<SocketPerformanceWatcher> socket_performance_watcher, |
| const BoundNetLog& net_log) |
| : net_log_(net_log), |
| session_(session), |
| @@ -306,7 +308,8 @@ QuicConnectionLogger::QuicConnectionLogger( |
| num_duplicate_packets_(0), |
| num_blocked_frames_received_(0), |
| num_blocked_frames_sent_(0), |
| - connection_description_(connection_description) {} |
| + connection_description_(connection_description), |
| + socket_performance_watcher_(socket_performance_watcher.Pass()) {} |
| QuicConnectionLogger::~QuicConnectionLogger() { |
| UMA_HISTOGRAM_COUNTS("Net.QuicSession.OutOfOrderPacketsReceived", |
| @@ -786,6 +789,18 @@ float QuicConnectionLogger::ReceivedPacketLossRate() const { |
| return num_received / largest_received_packet_number_; |
| } |
| +void QuicConnectionLogger::OnRttChanged(QuicTime::Delta rtt) const { |
| + // Notify socket performance watcher of the updated RTT value. |
| + if (!socket_performance_watcher_) |
| + return; |
| + |
| + long microseconds = rtt.ToMicroseconds(); |
|
Ryan Sleevi
2015/09/18 17:36:45
BUG: This should be int64
tbansal1
2015/09/18 17:59:59
Done. Thanks for catching that. This is what I get
|
| + if (microseconds != 0) { |
| + socket_performance_watcher_->OnUpdatedRTTAvailable( |
| + base::TimeDelta::FromMicroseconds(rtt.ToMicroseconds())); |
| + } |
| +} |
| + |
| void QuicConnectionLogger::RecordAggregatePacketLossRate() const { |
| // For short connections under 22 packets in length, we'll rely on the |
| // Net.QuicSession.21CumulativePacketsReceived_* histogram to indicate packet |