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

Side by Side Diff: net/quic/quic_flow_controller.cc

Issue 2132623002: Landing Recent QUIC changes until 2016-07-02 02:45 UTC (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removing comment about RPCs Created 4 years, 5 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
« no previous file with comments | « net/quic/quic_flags.cc ('k') | net/quic/quic_framer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #include "net/quic/quic_flow_controller.h" 5 #include "net/quic/quic_flow_controller.h"
6 6
7 #include "base/strings/stringprintf.h" 7 #include "base/strings/stringprintf.h"
8 #include "net/quic/quic_bug_tracker.h" 8 #include "net/quic/quic_bug_tracker.h"
9 #include "net/quic/quic_connection.h" 9 #include "net/quic/quic_connection.h"
10 #include "net/quic/quic_flags.h" 10 #include "net/quic/quic_flags.h"
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 128
129 // Get outbound RTT. 129 // Get outbound RTT.
130 QuicTime::Delta rtt = 130 QuicTime::Delta rtt =
131 connection_->sent_packet_manager().GetRttStats()->smoothed_rtt(); 131 connection_->sent_packet_manager().GetRttStats()->smoothed_rtt();
132 if (rtt.IsZero()) { 132 if (rtt.IsZero()) {
133 DVLOG(1) << ENDPOINT << "rtt zero for stream " << id_; 133 DVLOG(1) << ENDPOINT << "rtt zero for stream " << id_;
134 return; 134 return;
135 } 135 }
136 136
137 // Now we can compare timing of window updates with RTT. 137 // Now we can compare timing of window updates with RTT.
138 QuicTime::Delta since_last = now.Subtract(prev); 138 QuicTime::Delta since_last = now - prev;
139 QuicTime::Delta two_rtt = rtt.Multiply(2); 139 QuicTime::Delta two_rtt = 2 * rtt;
140 140
141 if (since_last >= two_rtt) { 141 if (since_last >= two_rtt) {
142 // If interval between window updates is sufficiently large, there 142 // If interval between window updates is sufficiently large, there
143 // is no need to increase receive_window_size_. 143 // is no need to increase receive_window_size_.
144 return; 144 return;
145 } 145 }
146 146
147 QuicByteCount old_window = receive_window_size_; 147 QuicByteCount old_window = receive_window_size_;
148 receive_window_size_ *= 2; 148 receive_window_size_ *= 2;
149 receive_window_size_ = 149 receive_window_size_ =
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
249 if (receive_window_size_ != receive_window_offset_) { 249 if (receive_window_size_ != receive_window_offset_) {
250 QUIC_BUG << "receive_window_size_:" << receive_window_size_ 250 QUIC_BUG << "receive_window_size_:" << receive_window_size_
251 << " != receive_window_offset:" << receive_window_offset_; 251 << " != receive_window_offset:" << receive_window_offset_;
252 return; 252 return;
253 } 253 }
254 receive_window_size_ = size; 254 receive_window_size_ = size;
255 receive_window_offset_ = size; 255 receive_window_offset_ = size;
256 } 256 }
257 257
258 } // namespace net 258 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/quic_flags.cc ('k') | net/quic/quic_framer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698