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

Side by Side Diff: net/quic/congestion_control/rtt_stats.h

Issue 968233004: Land Recent QUIC Changes until 03/02/2015. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@cleanup
Patch Set: Created 5 years, 9 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 // 4 //
5 // A convenience class to store rtt samples and calculate smoothed rtt. 5 // A convenience class to store rtt samples and calculate smoothed rtt.
6 6
7 #ifndef NET_QUIC_CONGESTION_CONTROL_RTT_STATS_H_ 7 #ifndef NET_QUIC_CONGESTION_CONTROL_RTT_STATS_H_
8 #define NET_QUIC_CONGESTION_CONTROL_RTT_STATS_H_ 8 #define NET_QUIC_CONGESTION_CONTROL_RTT_STATS_H_
9 9
10 #include <algorithm> 10 #include <algorithm>
11 11
12 #include "base/basictypes.h" 12 #include "base/basictypes.h"
13 #include "net/quic/quic_protocol.h" 13 #include "net/quic/quic_protocol.h"
14 #include "net/quic/quic_time.h" 14 #include "net/quic/quic_time.h"
15 15
16 namespace net { 16 namespace net {
17 17
18 namespace test { 18 namespace test {
19 class RttStatsPeer; 19 class RttStatsPeer;
20 } // namespace test 20 } // namespace test
21 21
22 class NET_EXPORT_PRIVATE RttStats { 22 class NET_EXPORT_PRIVATE RttStats {
23 public: 23 public:
24 RttStats(); 24 RttStats();
25 25
26 // Returns true if any RTT measurements have been made.
27 bool HasUpdates() const;
28
29 // Updates the RTT from an incoming ack which is received |send_delta| after 26 // Updates the RTT from an incoming ack which is received |send_delta| after
30 // the packet is sent and the peer reports the ack being delayed |ack_delay|. 27 // the packet is sent and the peer reports the ack being delayed |ack_delay|.
31 void UpdateRtt(QuicTime::Delta send_delta, 28 void UpdateRtt(QuicTime::Delta send_delta,
32 QuicTime::Delta ack_delay, 29 QuicTime::Delta ack_delay,
33 QuicTime now); 30 QuicTime now);
34 31
35 // Causes the smoothed_rtt to be increased to the latest_rtt if the latest_rtt 32 // Causes the smoothed_rtt to be increased to the latest_rtt if the latest_rtt
36 // is larger. The mean deviation is increased to the most recent deviation if 33 // is larger. The mean deviation is increased to the most recent deviation if
37 // it's larger. 34 // it's larger.
38 void ExpireSmoothedMetrics(); 35 void ExpireSmoothedMetrics();
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 RttSample recent_min_rtt_; // a in the windowed algorithm. 116 RttSample recent_min_rtt_; // a in the windowed algorithm.
120 RttSample half_window_rtt_; // b in the sampled algorithm. 117 RttSample half_window_rtt_; // b in the sampled algorithm.
121 RttSample quarter_window_rtt_; // c in the sampled algorithm. 118 RttSample quarter_window_rtt_; // c in the sampled algorithm.
122 119
123 DISALLOW_COPY_AND_ASSIGN(RttStats); 120 DISALLOW_COPY_AND_ASSIGN(RttStats);
124 }; 121 };
125 122
126 } // namespace net 123 } // namespace net
127 124
128 #endif // NET_QUIC_CONGESTION_CONTROL_RTT_STATS_H_ 125 #endif // NET_QUIC_CONGESTION_CONTROL_RTT_STATS_H_
OLDNEW
« no previous file with comments | « net/quic/congestion_control/prr_sender_test.cc ('k') | net/quic/congestion_control/send_algorithm_interface.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698