| OLD | NEW |
| 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 Loading... |
| 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_17) { | 39 if (connection_->version() <= QUIC_VERSION_16) { |
| 40 DVLOG(1) << ENDPOINT << "Disabling QuicFlowController for stream " << id_ | 40 DVLOG(1) << ENDPOINT << "Disabling QuicFlowController for stream " << id_ |
| 41 << ", QUIC version " << connection_->version(); | 41 << ", QUIC version " << connection_->version(); |
| 42 Disable(); | 42 Disable(); |
| 43 } | 43 } |
| 44 } | 44 } |
| 45 | 45 |
| 46 void QuicFlowController::AddBytesConsumed(uint64 bytes_consumed) { | 46 void QuicFlowController::AddBytesConsumed(uint64 bytes_consumed) { |
| 47 if (!IsEnabled()) { | 47 if (!IsEnabled()) { |
| 48 return; | 48 return; |
| 49 } | 49 } |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 } | 192 } |
| 193 | 193 |
| 194 uint64 QuicFlowController::SendWindowSize() const { | 194 uint64 QuicFlowController::SendWindowSize() const { |
| 195 if (bytes_sent_ > send_window_offset_) { | 195 if (bytes_sent_ > send_window_offset_) { |
| 196 return 0; | 196 return 0; |
| 197 } | 197 } |
| 198 return send_window_offset_ - bytes_sent_; | 198 return send_window_offset_ - bytes_sent_; |
| 199 } | 199 } |
| 200 | 200 |
| 201 } // namespace net | 201 } // namespace net |
| OLD | NEW |