| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/reliable_quic_stream.h" | 5 #include "net/quic/reliable_quic_stream.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "net/quic/iovector.h" | 8 #include "net/quic/iovector.h" |
| 9 #include "net/quic/quic_flow_controller.h" | 9 #include "net/quic/quic_flow_controller.h" |
| 10 #include "net/quic/quic_session.h" | 10 #include "net/quic/quic_session.h" |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 return session->config()->GetInitialStreamFlowControlWindowToSend(); | 35 return session->config()->GetInitialStreamFlowControlWindowToSend(); |
| 36 } | 36 } |
| 37 | 37 |
| 38 size_t GetReceivedFlowControlWindow(QuicSession* session) { | 38 size_t GetReceivedFlowControlWindow(QuicSession* session) { |
| 39 QuicVersion version = session->connection()->version(); | 39 QuicVersion version = session->connection()->version(); |
| 40 if (version <= QUIC_VERSION_19) { | 40 if (version <= QUIC_VERSION_19) { |
| 41 if (session->config()->HasReceivedInitialFlowControlWindowBytes()) { | 41 if (session->config()->HasReceivedInitialFlowControlWindowBytes()) { |
| 42 return session->config()->ReceivedInitialFlowControlWindowBytes(); | 42 return session->config()->ReceivedInitialFlowControlWindowBytes(); |
| 43 } | 43 } |
| 44 | 44 |
| 45 return kDefaultFlowControlSendWindow; | 45 return kMinimumFlowControlSendWindow; |
| 46 } | 46 } |
| 47 | 47 |
| 48 // Version must be >= QUIC_VERSION_21, so we check for stream specific flow | 48 // Version must be >= QUIC_VERSION_21, so we check for stream specific flow |
| 49 // control window. | 49 // control window. |
| 50 if (session->config()->HasReceivedInitialStreamFlowControlWindowBytes()) { | 50 if (session->config()->HasReceivedInitialStreamFlowControlWindowBytes()) { |
| 51 return session->config()->ReceivedInitialStreamFlowControlWindowBytes(); | 51 return session->config()->ReceivedInitialStreamFlowControlWindowBytes(); |
| 52 } | 52 } |
| 53 | 53 |
| 54 return kDefaultFlowControlSendWindow; | 54 return kMinimumFlowControlSendWindow; |
| 55 } | 55 } |
| 56 | 56 |
| 57 } // namespace | 57 } // namespace |
| 58 | 58 |
| 59 // Wrapper that aggregates OnAckNotifications for packets sent using | 59 // Wrapper that aggregates OnAckNotifications for packets sent using |
| 60 // WriteOrBufferData and delivers them to the original | 60 // WriteOrBufferData and delivers them to the original |
| 61 // QuicAckNotifier::DelegateInterface after all bytes written using | 61 // QuicAckNotifier::DelegateInterface after all bytes written using |
| 62 // WriteOrBufferData are acked. This level of indirection is | 62 // WriteOrBufferData are acked. This level of indirection is |
| 63 // necessary because the delegate interface provides no mechanism that | 63 // necessary because the delegate interface provides no mechanism that |
| 64 // WriteOrBufferData can use to inform it that the write required | 64 // WriteOrBufferData can use to inform it that the write required |
| (...skipping 476 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 541 | 541 |
| 542 bool ReliableQuicStream::IsFlowControlBlocked() { | 542 bool ReliableQuicStream::IsFlowControlBlocked() { |
| 543 if (flow_controller_.IsBlocked()) { | 543 if (flow_controller_.IsBlocked()) { |
| 544 return true; | 544 return true; |
| 545 } | 545 } |
| 546 return stream_contributes_to_connection_flow_control_ && | 546 return stream_contributes_to_connection_flow_control_ && |
| 547 connection_flow_controller_->IsBlocked(); | 547 connection_flow_controller_->IsBlocked(); |
| 548 } | 548 } |
| 549 | 549 |
| 550 } // namespace net | 550 } // namespace net |
| OLD | NEW |