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

Side by Side Diff: net/quic/congestion_control/inter_arrival_probe.cc

Issue 126513003: Land Recent QUIC Changes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 11 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 #include "net/quic/congestion_control/inter_arrival_probe.h" 5 #include "net/quic/congestion_control/inter_arrival_probe.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 9
10 namespace { 10 namespace {
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 } 44 }
45 } 45 }
46 46
47 void InterArrivalProbe::OnAcknowledgedPacket(QuicByteCount bytes) { 47 void InterArrivalProbe::OnAcknowledgedPacket(QuicByteCount bytes) {
48 if (!estimate_available_) { 48 if (!estimate_available_) {
49 DCHECK_LE(bytes, unacked_data_); 49 DCHECK_LE(bytes, unacked_data_);
50 unacked_data_ -= bytes; 50 unacked_data_ -= bytes;
51 } 51 }
52 } 52 }
53 53
54 void InterArrivalProbe::OnRetransmissionTimeout() {
55 if (!estimate_available_) {
56 unacked_data_ = 0;
57 }
58 }
59
54 QuicByteCount InterArrivalProbe::GetAvailableCongestionWindow() { 60 QuicByteCount InterArrivalProbe::GetAvailableCongestionWindow() {
55 if (estimate_available_) { 61 if (estimate_available_) {
56 return 0; 62 return 0;
57 } 63 }
58 return (kProbeSizePackets * max_segment_size_) - unacked_data_; 64 return (kProbeSizePackets * max_segment_size_) - unacked_data_;
59 } 65 }
60 66
61 void InterArrivalProbe::OnIncomingFeedback( 67 void InterArrivalProbe::OnIncomingFeedback(
62 QuicPacketSequenceNumber sequence_number, 68 QuicPacketSequenceNumber sequence_number,
63 QuicByteCount bytes_sent, 69 QuicByteCount bytes_sent,
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 break; 119 break;
114 } 120 }
115 estimate_available_ = true; 121 estimate_available_ = true;
116 available_channel_estimator_.reset(NULL); 122 available_channel_estimator_.reset(NULL);
117 DVLOG(1) << "Probe estimate:" 123 DVLOG(1) << "Probe estimate:"
118 << available_channel_estimate_.ToKBitsPerSecond() 124 << available_channel_estimate_.ToKBitsPerSecond()
119 << " Kbits/s"; 125 << " Kbits/s";
120 } 126 }
121 127
122 } // namespace net 128 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/congestion_control/inter_arrival_probe.h ('k') | net/quic/congestion_control/inter_arrival_sender.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698