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

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

Issue 15937012: Land Recent QUIC changes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Small bug fixes Created 7 years, 6 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/fix_rate_sender.h" 5 #include "net/quic/congestion_control/fix_rate_sender.h"
6 6
7 #include <math.h> 7 #include <math.h>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "net/quic/quic_protocol.h" 10 #include "net/quic/quic_protocol.h"
(...skipping 13 matching lines...) Expand all
24 latest_rtt_(QuicTime::Delta::Zero()) { 24 latest_rtt_(QuicTime::Delta::Zero()) {
25 DLOG(INFO) << "FixRateSender"; 25 DLOG(INFO) << "FixRateSender";
26 } 26 }
27 27
28 FixRateSender::~FixRateSender() { 28 FixRateSender::~FixRateSender() {
29 } 29 }
30 30
31 void FixRateSender::OnIncomingQuicCongestionFeedbackFrame( 31 void FixRateSender::OnIncomingQuicCongestionFeedbackFrame(
32 const QuicCongestionFeedbackFrame& feedback, 32 const QuicCongestionFeedbackFrame& feedback,
33 QuicTime feedback_receive_time, 33 QuicTime feedback_receive_time,
34 QuicBandwidth /*sent_bandwidth*/,
35 const SentPacketsMap& /*sent_packets*/) { 34 const SentPacketsMap& /*sent_packets*/) {
36 DCHECK(feedback.type == kFixRate) << 35 DCHECK(feedback.type == kFixRate) <<
37 "Invalid incoming CongestionFeedbackType:" << feedback.type; 36 "Invalid incoming CongestionFeedbackType:" << feedback.type;
38 if (feedback.type == kFixRate) { 37 if (feedback.type == kFixRate) {
39 bitrate_ = feedback.fix_rate.bitrate; 38 bitrate_ = feedback.fix_rate.bitrate;
40 fix_rate_leaky_bucket_.SetDrainingRate(feedback_receive_time, bitrate_); 39 fix_rate_leaky_bucket_.SetDrainingRate(feedback_receive_time, bitrate_);
41 paced_sender_.UpdateBandwidthEstimate(feedback_receive_time, bitrate_); 40 paced_sender_.UpdateBandwidthEstimate(feedback_receive_time, bitrate_);
42 } 41 }
43 // Silently ignore invalid messages in release mode. 42 // Silently ignore invalid messages in release mode.
44 } 43 }
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 QuicBandwidth FixRateSender::BandwidthEstimate() { 99 QuicBandwidth FixRateSender::BandwidthEstimate() {
101 return bitrate_; 100 return bitrate_;
102 } 101 }
103 102
104 QuicTime::Delta FixRateSender::SmoothedRtt() { 103 QuicTime::Delta FixRateSender::SmoothedRtt() {
105 // TODO(satyamshekhar): Calculate and return smoothed rtt. 104 // TODO(satyamshekhar): Calculate and return smoothed rtt.
106 return latest_rtt_; 105 return latest_rtt_;
107 } 106 }
108 107
109 } // namespace net 108 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698