| 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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 | 71 |
| 72 void set_receive_window_size_limit(QuicByteCount receive_window_size_limit) { | 72 void set_receive_window_size_limit(QuicByteCount receive_window_size_limit) { |
| 73 DCHECK_GE(receive_window_size_limit, receive_window_size_limit_); | 73 DCHECK_GE(receive_window_size_limit, receive_window_size_limit_); |
| 74 receive_window_size_limit_ = receive_window_size_limit; | 74 receive_window_size_limit_ = receive_window_size_limit; |
| 75 } | 75 } |
| 76 | 76 |
| 77 void set_auto_tune_receive_window(bool enable) { | 77 void set_auto_tune_receive_window(bool enable) { |
| 78 auto_tune_receive_window_ = enable; | 78 auto_tune_receive_window_ = enable; |
| 79 } | 79 } |
| 80 | 80 |
| 81 // Should only be called before any data is received. |
| 82 void UpdateReceiveWindowSize(QuicStreamOffset size); |
| 83 |
| 81 bool auto_tune_receive_window() { return auto_tune_receive_window_; } | 84 bool auto_tune_receive_window() { return auto_tune_receive_window_; } |
| 82 | 85 |
| 83 private: | 86 private: |
| 84 friend class test::QuicFlowControllerPeer; | 87 friend class test::QuicFlowControllerPeer; |
| 85 | 88 |
| 86 // Send a WINDOW_UPDATE frame if appropriate. | 89 // Send a WINDOW_UPDATE frame if appropriate. |
| 87 void MaybeSendWindowUpdate(); | 90 void MaybeSendWindowUpdate(); |
| 88 | 91 |
| 89 // Auto-tune the max receive window size. | 92 // Auto-tune the max receive window size. |
| 90 void MaybeIncreaseMaxWindowSize(); | 93 void MaybeIncreaseMaxWindowSize(); |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 // Keep time of the last time a window update was sent. We use this | 163 // Keep time of the last time a window update was sent. We use this |
| 161 // as part of the receive window auto tuning. | 164 // as part of the receive window auto tuning. |
| 162 QuicTime prev_window_update_time_; | 165 QuicTime prev_window_update_time_; |
| 163 | 166 |
| 164 DISALLOW_COPY_AND_ASSIGN(QuicFlowController); | 167 DISALLOW_COPY_AND_ASSIGN(QuicFlowController); |
| 165 }; | 168 }; |
| 166 | 169 |
| 167 } // namespace net | 170 } // namespace net |
| 168 | 171 |
| 169 #endif // NET_QUIC_QUIC_FLOW_CONTROLLER_H_ | 172 #endif // NET_QUIC_QUIC_FLOW_CONTROLLER_H_ |
| OLD | NEW |