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

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

Issue 444313002: Deprecate rolled out FLAGS_enable_quic_connection_flow_control_2. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@Final_0807
Patch Set: Created 6 years, 4 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_headers_stream_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 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 172
173 send_window_offset_ = new_send_window_offset; 173 send_window_offset_ = new_send_window_offset;
174 return true; 174 return true;
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 return is_enabled_;
183 (id_ == kConnectionLevelId &&
184 FLAGS_enable_quic_connection_flow_control_2);
185 bool stream_flow_control_enabled = (id_ != kConnectionLevelId);
186 return (connection_flow_control_enabled || stream_flow_control_enabled) &&
187 is_enabled_;
188 } 183 }
189 184
190 bool QuicFlowController::IsBlocked() const { 185 bool QuicFlowController::IsBlocked() const {
191 return IsEnabled() && SendWindowSize() == 0; 186 return IsEnabled() && SendWindowSize() == 0;
192 } 187 }
193 188
194 uint64 QuicFlowController::SendWindowSize() const { 189 uint64 QuicFlowController::SendWindowSize() const {
195 if (bytes_sent_ > send_window_offset_) { 190 if (bytes_sent_ > send_window_offset_) {
196 return 0; 191 return 0;
197 } 192 }
198 return send_window_offset_ - bytes_sent_; 193 return send_window_offset_ - bytes_sent_;
199 } 194 }
200 195
201 } // namespace net 196 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/quic_flags.cc ('k') | net/quic/quic_headers_stream_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698