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

Unified Diff: net/quic/quic_connection_logger.cc

Issue 1305293004: Notfiy NQE of QUIC RTT (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed a test Created 5 years, 3 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 | « net/quic/quic_connection_logger.h ('k') | net/quic/quic_connection_logger_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/quic_connection_logger.cc
diff --git a/net/quic/quic_connection_logger.cc b/net/quic/quic_connection_logger.cc
index 54b6cd419d8852902838179c05c1d695a00549cd..47620acfedf33b7348744f9c8d8d4f2fd48d6b31 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),
@@ -307,7 +309,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",
@@ -797,6 +800,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;
+
+ int64_t microseconds = rtt.ToMicroseconds();
+ 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
« no previous file with comments | « net/quic/quic_connection_logger.h ('k') | net/quic/quic_connection_logger_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698