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_QUIC_FLOW_CONTROLLER_H_ | 5 #ifndef NET_QUIC_QUIC_FLOW_CONTROLLER_H_ |
6 #define NET_QUIC_QUIC_FLOW_CONTROLLER_H_ | 6 #define NET_QUIC_QUIC_FLOW_CONTROLLER_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "net/base/net_export.h" | 9 #include "net/base/net_export.h" |
10 #include "net/quic/quic_protocol.h" | 10 #include "net/quic/quic_protocol.h" |
(...skipping 29 matching lines...) Expand all Loading... |
40 bool UpdateHighestReceivedOffset(uint64 new_offset); | 40 bool UpdateHighestReceivedOffset(uint64 new_offset); |
41 | 41 |
42 // Called when bytes received from the peer are consumed locally. This may | 42 // Called when bytes received from the peer are consumed locally. This may |
43 // trigger the sending of a WINDOW_UPDATE frame using |connection|. | 43 // trigger the sending of a WINDOW_UPDATE frame using |connection|. |
44 void AddBytesConsumed(uint64 bytes_consumed); | 44 void AddBytesConsumed(uint64 bytes_consumed); |
45 | 45 |
46 // Called when bytes are sent to the peer. | 46 // Called when bytes are sent to the peer. |
47 void AddBytesSent(uint64 bytes_sent); | 47 void AddBytesSent(uint64 bytes_sent); |
48 | 48 |
49 // Set a new send window offset. | 49 // Set a new send window offset. |
50 // Returns true if this changes send_window_offset_, and false in the case | 50 // Returns true if this increases send_window_offset_ and is now blocked. |
51 // where |new_send_window| is <= send_window_offset_. | |
52 bool UpdateSendWindowOffset(uint64 new_send_window_offset); | 51 bool UpdateSendWindowOffset(uint64 new_send_window_offset); |
53 | 52 |
54 // Returns the current available send window. | 53 // Returns the current available send window. |
55 uint64 SendWindowSize() const; | 54 uint64 SendWindowSize() const; |
56 | 55 |
57 // Send a BLOCKED frame if appropriate. | 56 // Send a BLOCKED frame if appropriate. |
58 void MaybeSendBlocked(); | 57 void MaybeSendBlocked(); |
59 | 58 |
60 // Disable flow control. | 59 // Disable flow control. |
61 void Disable(); | 60 void Disable(); |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 // Keep track of the last time we sent a BLOCKED frame. We should only send | 120 // Keep track of the last time we sent a BLOCKED frame. We should only send |
122 // another when the number of bytes we have sent has changed. | 121 // another when the number of bytes we have sent has changed. |
123 uint64 last_blocked_send_window_offset_; | 122 uint64 last_blocked_send_window_offset_; |
124 | 123 |
125 DISALLOW_COPY_AND_ASSIGN(QuicFlowController); | 124 DISALLOW_COPY_AND_ASSIGN(QuicFlowController); |
126 }; | 125 }; |
127 | 126 |
128 } // namespace net | 127 } // namespace net |
129 | 128 |
130 #endif // NET_QUIC_QUIC_FLOW_CONTROLLER_H_ | 129 #endif // NET_QUIC_QUIC_FLOW_CONTROLLER_H_ |
OLD | NEW |