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 342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
353 | 353 |
354 // Writing more data would be a violation of flow control. | 354 // Writing more data would be a violation of flow control. |
355 write_length = send_window; | 355 write_length = send_window; |
356 } | 356 } |
357 } | 357 } |
358 | 358 |
359 // Fill an IOVector with bytes from the iovec. | 359 // Fill an IOVector with bytes from the iovec. |
360 IOVector data; | 360 IOVector data; |
361 data.AppendIovecAtMostBytes(iov, iov_count, write_length); | 361 data.AppendIovecAtMostBytes(iov, iov_count, write_length); |
362 | 362 |
| 363 // TODO(jri): Use the correct FecProtection based on FecPolicy on stream. |
363 QuicConsumedData consumed_data = session()->WritevData( | 364 QuicConsumedData consumed_data = session()->WritevData( |
364 id(), data, stream_bytes_written_, fin, ack_notifier_delegate); | 365 id(), data, stream_bytes_written_, fin, MAY_FEC_PROTECT, |
| 366 ack_notifier_delegate); |
365 stream_bytes_written_ += consumed_data.bytes_consumed; | 367 stream_bytes_written_ += consumed_data.bytes_consumed; |
366 | 368 |
367 AddBytesSent(consumed_data.bytes_consumed); | 369 AddBytesSent(consumed_data.bytes_consumed); |
368 | 370 |
369 if (consumed_data.bytes_consumed == write_length) { | 371 if (consumed_data.bytes_consumed == write_length) { |
370 if (!fin_with_zero_data) { | 372 if (!fin_with_zero_data) { |
371 MaybeSendBlocked(); | 373 MaybeSendBlocked(); |
372 } | 374 } |
373 if (fin && consumed_data.fin_consumed) { | 375 if (fin && consumed_data.fin_consumed) { |
374 fin_sent_ = true; | 376 fin_sent_ = true; |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
486 connection_flow_controller_->AddBytesConsumed(bytes); | 488 connection_flow_controller_->AddBytesConsumed(bytes); |
487 } | 489 } |
488 } | 490 } |
489 | 491 |
490 bool ReliableQuicStream::IsFlowControlBlocked() { | 492 bool ReliableQuicStream::IsFlowControlBlocked() { |
491 return flow_controller_.IsBlocked() || | 493 return flow_controller_.IsBlocked() || |
492 connection_flow_controller_->IsBlocked(); | 494 connection_flow_controller_->IsBlocked(); |
493 } | 495 } |
494 | 496 |
495 } // namespace net | 497 } // namespace net |
OLD | NEW |