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

Side by Side Diff: net/quic/reliable_quic_stream.cc

Issue 335533002: API changes to Write path Session on down for 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « net/quic/quic_session_test.cc ('k') | net/quic/reliable_quic_stream_test.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « net/quic/quic_session_test.cc ('k') | net/quic/reliable_quic_stream_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698