| 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 #ifndef NET_QUIC_CORE_QUIC_FLOW_CONTROLLER_H_ | 5 #ifndef NET_QUIC_CORE_QUIC_FLOW_CONTROLLER_H_ |
| 6 #define NET_QUIC_CORE_QUIC_FLOW_CONTROLLER_H_ | 6 #define NET_QUIC_CORE_QUIC_FLOW_CONTROLLER_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "net/quic/core/quic_packets.h" | 9 #include "net/quic/core/quic_packets.h" |
| 10 #include "net/quic/platform/api/quic_export.h" | 10 #include "net/quic/platform/api/quic_export.h" |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 // in the case where |new_offset| is <= highest_received_byte_offset_. | 55 // in the case where |new_offset| is <= highest_received_byte_offset_. |
| 56 bool UpdateHighestReceivedOffset(QuicStreamOffset new_offset); | 56 bool UpdateHighestReceivedOffset(QuicStreamOffset new_offset); |
| 57 | 57 |
| 58 // Called when bytes received from the peer are consumed locally. This may | 58 // Called when bytes received from the peer are consumed locally. This may |
| 59 // trigger the sending of a WINDOW_UPDATE frame using |connection|. | 59 // trigger the sending of a WINDOW_UPDATE frame using |connection|. |
| 60 void AddBytesConsumed(QuicByteCount bytes_consumed); | 60 void AddBytesConsumed(QuicByteCount bytes_consumed); |
| 61 | 61 |
| 62 // Called when bytes are sent to the peer. | 62 // Called when bytes are sent to the peer. |
| 63 void AddBytesSent(QuicByteCount bytes_sent); | 63 void AddBytesSent(QuicByteCount bytes_sent); |
| 64 | 64 |
| 65 // Set a new send window offset. | 65 // Increases |send_window_offset_| if |new_send_window_offset| is |
| 66 // Returns true if this increases send_window_offset_ and is now blocked. | 66 // greater than the current value. Returns true if this increase |
| 67 // also causes us to change from a blocked state to unblocked. In |
| 68 // all other cases, returns false. |
| 67 bool UpdateSendWindowOffset(QuicStreamOffset new_send_window_offset); | 69 bool UpdateSendWindowOffset(QuicStreamOffset new_send_window_offset); |
| 68 | 70 |
| 69 // QuicFlowControllerInterface. | 71 // QuicFlowControllerInterface. |
| 70 void EnsureWindowAtLeast(QuicByteCount window_size) override; | 72 void EnsureWindowAtLeast(QuicByteCount window_size) override; |
| 71 | 73 |
| 72 // Returns the current available send window. | 74 // Returns the current available send window. |
| 73 QuicByteCount SendWindowSize() const; | 75 QuicByteCount SendWindowSize() const; |
| 74 | 76 |
| 75 // Send a BLOCKED frame if appropriate. | 77 // Send a BLOCKED frame if appropriate. |
| 76 void MaybeSendBlocked(); | 78 void MaybeSendBlocked(); |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 190 // Keep time of the last time a window update was sent. We use this | 192 // Keep time of the last time a window update was sent. We use this |
| 191 // as part of the receive window auto tuning. | 193 // as part of the receive window auto tuning. |
| 192 QuicTime prev_window_update_time_; | 194 QuicTime prev_window_update_time_; |
| 193 | 195 |
| 194 DISALLOW_COPY_AND_ASSIGN(QuicFlowController); | 196 DISALLOW_COPY_AND_ASSIGN(QuicFlowController); |
| 195 }; | 197 }; |
| 196 | 198 |
| 197 } // namespace net | 199 } // namespace net |
| 198 | 200 |
| 199 #endif // NET_QUIC_CORE_QUIC_FLOW_CONTROLLER_H_ | 201 #endif // NET_QUIC_CORE_QUIC_FLOW_CONTROLLER_H_ |
| OLD | NEW |