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

Unified Diff: net/quic/core/quic_stream.cc

Issue 2963763003: In QUIC, send data is copied to streams rather than frames. Protected by FLAGS_quic_reloadable_flag… (Closed)
Patch Set: Rebase Created 3 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/core/quic_stream.h ('k') | net/quic/core/quic_stream_frame_data_producer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/core/quic_stream.cc
diff --git a/net/quic/core/quic_stream.cc b/net/quic/core/quic_stream.cc
index 4e8d7a65835736b7d700319e634732dc099e6aab..e8583b62c043d0d8102a3b5797026167452e67b7 100644
--- a/net/quic/core/quic_stream.cc
+++ b/net/quic/core/quic_stream.cc
@@ -77,7 +77,8 @@ QuicStream::QuicStream(QuicStreamId id, QuicSession* session)
stream_contributes_to_connection_flow_control_(true),
busy_counter_(0),
add_random_padding_after_fin_(false),
- ack_listener_(nullptr) {
+ ack_listener_(nullptr),
+ send_buffer_(session->connection()->helper()->GetBufferAllocator()) {
SetFromConfig();
}
@@ -532,6 +533,9 @@ void QuicStream::OnStreamFrameDiscarded(const QuicStreamFrame& frame) {
if (frame.fin) {
fin_outstanding_ = false;
}
+ if (session_->streams_own_data() && frame.data_length > 0) {
+ send_buffer_.RemoveStreamFrame(frame.offset, frame.data_length);
+ }
if (!IsWaitingForAcks()) {
session_->OnStreamDoneWaitingForAcks(id_);
}
@@ -541,4 +545,19 @@ bool QuicStream::IsWaitingForAcks() const {
return stream_bytes_outstanding_ || fin_outstanding_;
}
+void QuicStream::SaveStreamData(QuicIOVector iov,
+ size_t iov_offset,
+ QuicStreamOffset offset,
+ QuicByteCount data_length) {
+ DCHECK_LT(0u, data_length);
+ send_buffer_.SaveStreamData(iov, iov_offset, offset, data_length);
+}
+
+bool QuicStream::WriteStreamData(QuicStreamOffset offset,
+ QuicByteCount data_length,
+ QuicDataWriter* writer) {
+ DCHECK_LT(0u, data_length);
+ return send_buffer_.WriteStreamData(offset, data_length, writer);
+}
+
} // namespace net
« no previous file with comments | « net/quic/core/quic_stream.h ('k') | net/quic/core/quic_stream_frame_data_producer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698