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

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

Issue 605163004: Land Recent QUIC Changes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@Final_0925
Patch Set: Created 6 years, 2 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_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 18 matching lines...) Expand all
29 send_window_offset_(send_window_offset), 29 send_window_offset_(send_window_offset),
30 receive_window_offset_(receive_window_offset), 30 receive_window_offset_(receive_window_offset),
31 max_receive_window_(max_receive_window), 31 max_receive_window_(max_receive_window),
32 last_blocked_send_window_offset_(0) { 32 last_blocked_send_window_offset_(0) {
33 DVLOG(1) << ENDPOINT << "Created flow controller for stream " << id_ 33 DVLOG(1) << ENDPOINT << "Created flow controller for stream " << id_
34 << ", setting initial receive window offset to: " 34 << ", setting initial receive window offset to: "
35 << receive_window_offset_ 35 << receive_window_offset_
36 << ", max receive window to: " 36 << ", max receive window to: "
37 << max_receive_window_ 37 << max_receive_window_
38 << ", setting send window offset to: " << send_window_offset_; 38 << ", setting send window offset to: " << send_window_offset_;
39 if (connection_->version() <= QUIC_VERSION_16) {
40 DVLOG(1) << ENDPOINT << "Disabling QuicFlowController for stream " << id_
41 << ", QUIC version " << connection_->version();
42 Disable();
43 }
44 } 39 }
45 40
46 void QuicFlowController::AddBytesConsumed(uint64 bytes_consumed) { 41 void QuicFlowController::AddBytesConsumed(uint64 bytes_consumed) {
47 if (!IsEnabled()) { 42 if (!IsEnabled()) {
48 return; 43 return;
49 } 44 }
50 45
51 bytes_consumed_ += bytes_consumed; 46 bytes_consumed_ += bytes_consumed;
52 DVLOG(1) << ENDPOINT << "Stream " << id_ << " consumed: " << bytes_consumed_; 47 DVLOG(1) << ENDPOINT << "Stream " << id_ << " consumed: " << bytes_consumed_;
53 48
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
187 } 182 }
188 183
189 uint64 QuicFlowController::SendWindowSize() const { 184 uint64 QuicFlowController::SendWindowSize() const {
190 if (bytes_sent_ > send_window_offset_) { 185 if (bytes_sent_ > send_window_offset_) {
191 return 0; 186 return 0;
192 } 187 }
193 return send_window_offset_ - bytes_sent_; 188 return send_window_offset_ - bytes_sent_;
194 } 189 }
195 190
196 } // namespace net 191 } // 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