OLD | NEW |
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 <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 12 matching lines...) Expand all Loading... |
23 InterArrivalProbe::InterArrivalProbe(QuicByteCount max_segment_size) | 23 InterArrivalProbe::InterArrivalProbe(QuicByteCount max_segment_size) |
24 : max_segment_size_(max_segment_size), | 24 : max_segment_size_(max_segment_size), |
25 estimate_available_(false), | 25 estimate_available_(false), |
26 available_channel_estimate_(QuicBandwidth::Zero()), | 26 available_channel_estimate_(QuicBandwidth::Zero()), |
27 unacked_data_(0) { | 27 unacked_data_(0) { |
28 } | 28 } |
29 | 29 |
30 InterArrivalProbe::~InterArrivalProbe() { | 30 InterArrivalProbe::~InterArrivalProbe() { |
31 } | 31 } |
32 | 32 |
33 void InterArrivalProbe::set_max_segment_size(QuicByteCount max_segment_size) { | |
34 max_segment_size_ = max_segment_size; | |
35 } | |
36 | |
37 bool InterArrivalProbe::GetEstimate(QuicBandwidth* available_channel_estimate) { | 33 bool InterArrivalProbe::GetEstimate(QuicBandwidth* available_channel_estimate) { |
38 if (!estimate_available_) { | 34 if (!estimate_available_) { |
39 return false; | 35 return false; |
40 } | 36 } |
41 *available_channel_estimate = available_channel_estimate_; | 37 *available_channel_estimate = available_channel_estimate_; |
42 return true; | 38 return true; |
43 } | 39 } |
44 | 40 |
45 void InterArrivalProbe::OnPacketSent(QuicByteCount bytes) { | 41 void InterArrivalProbe::OnPacketSent(QuicByteCount bytes) { |
46 if (!estimate_available_) { | 42 if (!estimate_available_) { |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 break; | 119 break; |
124 } | 120 } |
125 estimate_available_ = true; | 121 estimate_available_ = true; |
126 available_channel_estimator_.reset(NULL); | 122 available_channel_estimator_.reset(NULL); |
127 DVLOG(1) << "Probe estimate:" | 123 DVLOG(1) << "Probe estimate:" |
128 << available_channel_estimate_.ToKBitsPerSecond() | 124 << available_channel_estimate_.ToKBitsPerSecond() |
129 << " Kbits/s"; | 125 << " Kbits/s"; |
130 } | 126 } |
131 | 127 |
132 } // namespace net | 128 } // namespace net |
OLD | NEW |