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

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

Issue 357573004: Land Recent QUIC Changes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase with TOT Created 6 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 | Annotate | Revision Log
« 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 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 } 175 }
176 176
177 void QuicFlowController::Disable() { 177 void QuicFlowController::Disable() {
178 is_enabled_ = false; 178 is_enabled_ = false;
179 } 179 }
180 180
181 bool QuicFlowController::IsEnabled() const { 181 bool QuicFlowController::IsEnabled() const {
182 bool connection_flow_control_enabled = 182 bool connection_flow_control_enabled =
183 (id_ == kConnectionLevelId && 183 (id_ == kConnectionLevelId &&
184 FLAGS_enable_quic_connection_flow_control_2); 184 FLAGS_enable_quic_connection_flow_control_2);
185 bool stream_flow_control_enabled = 185 bool stream_flow_control_enabled = (id_ != kConnectionLevelId);
186 (id_ != kConnectionLevelId &&
187 FLAGS_enable_quic_stream_flow_control_2);
188 return (connection_flow_control_enabled || stream_flow_control_enabled) && 186 return (connection_flow_control_enabled || stream_flow_control_enabled) &&
189 is_enabled_; 187 is_enabled_;
190 } 188 }
191 189
192 bool QuicFlowController::IsBlocked() const { 190 bool QuicFlowController::IsBlocked() const {
193 return IsEnabled() && SendWindowSize() == 0; 191 return IsEnabled() && SendWindowSize() == 0;
194 } 192 }
195 193
196 uint64 QuicFlowController::SendWindowSize() const { 194 uint64 QuicFlowController::SendWindowSize() const {
197 if (bytes_sent_ > send_window_offset_) { 195 if (bytes_sent_ > send_window_offset_) {
198 return 0; 196 return 0;
199 } 197 }
200 return send_window_offset_ - bytes_sent_; 198 return send_window_offset_ - bytes_sent_;
201 } 199 }
202 200
203 } // namespace net 201 } // 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