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

Unified Diff: net/quic/quic_stream_sequencer.cc

Issue 17302002: Land Recent QUIC changes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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/quic_stream_sequencer.h ('k') | net/quic/quic_stream_sequencer_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/quic_stream_sequencer.cc
diff --git a/net/quic/quic_stream_sequencer.cc b/net/quic/quic_stream_sequencer.cc
index 3ab5211420786b01021425f114cd6de30a7adec8..146a77cd9a6cbc9abeb39a97e7563f39fe1b22f6 100644
--- a/net/quic/quic_stream_sequencer.cc
+++ b/net/quic/quic_stream_sequencer.cc
@@ -19,8 +19,7 @@ QuicStreamSequencer::QuicStreamSequencer(ReliableQuicStream* quic_stream)
: stream_(quic_stream),
num_bytes_consumed_(0),
max_frame_memory_(numeric_limits<size_t>::max()),
- close_offset_(numeric_limits<QuicStreamOffset>::max()),
- half_close_(true) {
+ close_offset_(numeric_limits<QuicStreamOffset>::max()) {
}
QuicStreamSequencer::QuicStreamSequencer(size_t max_frame_memory,
@@ -28,8 +27,7 @@ QuicStreamSequencer::QuicStreamSequencer(size_t max_frame_memory,
: stream_(quic_stream),
num_bytes_consumed_(0),
max_frame_memory_(max_frame_memory),
- close_offset_(numeric_limits<QuicStreamOffset>::max()),
- half_close_(true) {
+ close_offset_(numeric_limits<QuicStreamOffset>::max()) {
if (max_frame_memory < kMaxPacketSize) {
LOG(DFATAL) << "Setting max frame memory to " << max_frame_memory
<< ". Some frames will be impossible to handle.";
@@ -106,22 +104,17 @@ bool QuicStreamSequencer::OnStreamFrame(const QuicStreamFrame& frame) {
return true;
}
-void QuicStreamSequencer::CloseStreamAtOffset(QuicStreamOffset offset,
- bool half_close) {
+void QuicStreamSequencer::CloseStreamAtOffset(QuicStreamOffset offset) {
const QuicStreamOffset kMaxOffset = numeric_limits<QuicStreamOffset>::max();
// If we have a scheduled termination or close, any new offset should match
// it.
if (close_offset_ != kMaxOffset && offset != close_offset_) {
- stream_->Close(QUIC_MULTIPLE_TERMINATION_OFFSETS);
- return;
+ stream_->Close(QUIC_MULTIPLE_TERMINATION_OFFSETS);
+ return;
}
close_offset_ = offset;
- // Full close overrides half close.
- if (half_close == false) {
- half_close_ = false;
- }
MaybeCloseStream();
}
@@ -133,7 +126,7 @@ bool QuicStreamSequencer::MaybeCloseStream() {
<< " bytes.";
// Technically it's an error if num_bytes_consumed isn't exactly
// equal, but error handling seems silly at this point.
- stream_->TerminateFromPeer(half_close_);
+ stream_->TerminateFromPeer(true);
return true;
}
return false;
@@ -230,10 +223,6 @@ bool QuicStreamSequencer::IsHalfClosed() const {
return num_bytes_consumed_ >= close_offset_;
}
-bool QuicStreamSequencer::IsClosed() const {
- return num_bytes_consumed_ >= close_offset_ && half_close_ == false;
-}
-
bool QuicStreamSequencer::IsDuplicate(const QuicStreamFrame& frame) const {
// A frame is duplicate if the frame offset is smaller than our bytes consumed
// or we have stored the frame in our map.
« no previous file with comments | « net/quic/quic_stream_sequencer.h ('k') | net/quic/quic_stream_sequencer_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698