Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(388)

Unified Diff: net/quic/reliable_quic_stream.cc

Issue 338623002: Added FEC policy per stream, which is translated to an FEC protection (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/quic/reliable_quic_stream.h ('k') | net/quic/reliable_quic_stream_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/reliable_quic_stream.cc
diff --git a/net/quic/reliable_quic_stream.cc b/net/quic/reliable_quic_stream.cc
index 6bef6c43854d70aa653a1df3dbc2dc284828a43c..e33fb972dfe589782da3eb6439bdaa1716c5d669 100644
--- a/net/quic/reliable_quic_stream.cc
+++ b/net/quic/reliable_quic_stream.cc
@@ -124,6 +124,7 @@ ReliableQuicStream::ReliableQuicStream(QuicStreamId id, QuicSession* session)
fin_received_(false),
rst_sent_(false),
rst_received_(false),
+ fec_policy_(PROTECT_OPTIONAL),
is_server_(session_->is_server()),
flow_controller_(
session_->connection(),
@@ -360,9 +361,8 @@ QuicConsumedData ReliableQuicStream::WritevData(
IOVector data;
data.AppendIovecAtMostBytes(iov, iov_count, write_length);
- // TODO(jri): Use the correct FecProtection based on FecPolicy on stream.
QuicConsumedData consumed_data = session()->WritevData(
- id(), data, stream_bytes_written_, fin, MAY_FEC_PROTECT,
+ id(), data, stream_bytes_written_, fin, GetFecProtection(),
ack_notifier_delegate);
stream_bytes_written_ += consumed_data.bytes_consumed;
@@ -384,6 +384,10 @@ QuicConsumedData ReliableQuicStream::WritevData(
return consumed_data;
}
+FecProtection ReliableQuicStream::GetFecProtection() {
+ return fec_policy_ == PROTECT_ALWAYS ? MUST_FEC_PROTECT : MAY_FEC_PROTECT;
+}
+
void ReliableQuicStream::CloseReadSide() {
if (read_side_closed_) {
return;
« no previous file with comments | « net/quic/reliable_quic_stream.h ('k') | net/quic/reliable_quic_stream_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698