| 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_bug_tracker.h" | 9 #include "net/quic/quic_bug_tracker.h" |
| 10 #include "net/quic/quic_flags.h" | 10 #include "net/quic/quic_flags.h" |
| (...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 283 // A FIN with zero data payload should not be flow control blocked. | 283 // A FIN with zero data payload should not be flow control blocked. |
| 284 bool fin_with_zero_data = (fin && write_length == 0); | 284 bool fin_with_zero_data = (fin && write_length == 0); |
| 285 | 285 |
| 286 // How much data flow control permits to be written. | 286 // How much data flow control permits to be written. |
| 287 QuicByteCount send_window = flow_controller_.SendWindowSize(); | 287 QuicByteCount send_window = flow_controller_.SendWindowSize(); |
| 288 if (stream_contributes_to_connection_flow_control_) { | 288 if (stream_contributes_to_connection_flow_control_) { |
| 289 send_window = | 289 send_window = |
| 290 min(send_window, connection_flow_controller_->SendWindowSize()); | 290 min(send_window, connection_flow_controller_->SendWindowSize()); |
| 291 } | 291 } |
| 292 | 292 |
| 293 if (FLAGS_quic_cede_correctly && session_->ShouldYield(id())) { | 293 if (session_->ShouldYield(id())) { |
| 294 session_->MarkConnectionLevelWriteBlocked(id()); | 294 session_->MarkConnectionLevelWriteBlocked(id()); |
| 295 return QuicConsumedData(0, false); | 295 return QuicConsumedData(0, false); |
| 296 } | 296 } |
| 297 | 297 |
| 298 if (send_window == 0 && !fin_with_zero_data) { | 298 if (send_window == 0 && !fin_with_zero_data) { |
| 299 // Quick return if nothing can be sent. | 299 // Quick return if nothing can be sent. |
| 300 MaybeSendBlocked(); | 300 MaybeSendBlocked(); |
| 301 return QuicConsumedData(0, false); | 301 return QuicConsumedData(0, false); |
| 302 } | 302 } |
| 303 | 303 |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 457 } | 457 } |
| 458 } | 458 } |
| 459 | 459 |
| 460 void ReliableQuicStream::UpdateSendWindowOffset(QuicStreamOffset new_window) { | 460 void ReliableQuicStream::UpdateSendWindowOffset(QuicStreamOffset new_window) { |
| 461 if (flow_controller_.UpdateSendWindowOffset(new_window)) { | 461 if (flow_controller_.UpdateSendWindowOffset(new_window)) { |
| 462 OnCanWrite(); | 462 OnCanWrite(); |
| 463 } | 463 } |
| 464 } | 464 } |
| 465 | 465 |
| 466 } // namespace net | 466 } // namespace net |
| OLD | NEW |