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

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

Issue 1421853006: Landing Recent QUIC changes until: Fri Oct 30 22:23:58 2015 +0000 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix comments Created 5 years, 1 month 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_flow_controller_test.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/basictypes.h" 7 #include "base/basictypes.h"
8 #include "net/quic/quic_connection.h" 8 #include "net/quic/quic_connection.h"
9 #include "net/quic/quic_flags.h" 9 #include "net/quic/quic_flags.h"
10 #include "net/quic/quic_protocol.h" 10 #include "net/quic/quic_protocol.h"
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 // Send WindowUpdate to increase receive window if 169 // Send WindowUpdate to increase receive window if
170 // (receive window offset - consumed bytes) < (max window / 2). 170 // (receive window offset - consumed bytes) < (max window / 2).
171 // This is behaviour copied from SPDY. 171 // This is behaviour copied from SPDY.
172 DCHECK_LE(bytes_consumed_, receive_window_offset_); 172 DCHECK_LE(bytes_consumed_, receive_window_offset_);
173 QuicStreamOffset available_window = receive_window_offset_ - bytes_consumed_; 173 QuicStreamOffset available_window = receive_window_offset_ - bytes_consumed_;
174 QuicByteCount threshold = WindowUpdateThreshold(); 174 QuicByteCount threshold = WindowUpdateThreshold();
175 175
176 if (available_window >= threshold) { 176 if (available_window >= threshold) {
177 DVLOG(1) << ENDPOINT << "Not sending WindowUpdate for stream " << id_ 177 DVLOG(1) << ENDPOINT << "Not sending WindowUpdate for stream " << id_
178 << ", available window: " << available_window 178 << ", available window: " << available_window
179 << ">= threshold: " << threshold; 179 << " >= threshold: " << threshold;
180 return; 180 return;
181 } 181 }
182 182
183 MaybeIncreaseMaxWindowSize(); 183 MaybeIncreaseMaxWindowSize();
184 184
185 // Update our receive window. 185 // Update our receive window.
186 receive_window_offset_ += (receive_window_size_ - available_window); 186 receive_window_offset_ += (receive_window_size_ - available_window);
187 187
188 DVLOG(1) << ENDPOINT << "Sending WindowUpdate frame for stream " << id_ 188 DVLOG(1) << ENDPOINT << "Sending WindowUpdate frame for stream " << id_
189 << ", consumed bytes: " << bytes_consumed_ 189 << ", consumed bytes: " << bytes_consumed_
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 if (receive_window_size_ != receive_window_offset_) { 247 if (receive_window_size_ != receive_window_offset_) {
248 LOG(DFATAL) << "receive_window_size_:" << receive_window_size_ 248 LOG(DFATAL) << "receive_window_size_:" << receive_window_size_
249 << " != receive_window_offset:" << receive_window_offset_; 249 << " != receive_window_offset:" << receive_window_offset_;
250 return; 250 return;
251 } 251 }
252 receive_window_size_ = size; 252 receive_window_size_ = size;
253 receive_window_offset_ = size; 253 receive_window_offset_ = size;
254 } 254 }
255 255
256 } // namespace net 256 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/quic_flags.cc ('k') | net/quic/quic_flow_controller_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698