Change name of QuicStream::HasFinalReceivedByteOffset() to HasReiceivedFinalOffset().
The new name is clearer on what to expect.
gfe-relnote: no behavior change. Not protected.
PiperOrigin-RevId: 278497389
Change-Id: Ia52ca9f3bcf56c2272553281aefc9723032aa4de
diff --git a/quic/core/http/quic_spdy_stream_test.cc b/quic/core/http/quic_spdy_stream_test.cc
index 26a6acb..0e6161b 100644
--- a/quic/core/http/quic_spdy_stream_test.cc
+++ b/quic/core/http/quic_spdy_stream_test.cc
@@ -382,7 +382,7 @@
EXPECT_EQ("", stream_->data());
EXPECT_FALSE(stream_->header_list().empty());
EXPECT_FALSE(stream_->IsDoneReading());
- EXPECT_TRUE(stream_->HasFinalReceivedByteOffset());
+ EXPECT_TRUE(stream_->HasReceivedFinalOffset());
}
// A valid status code should be 3-digit integer. The first digit should be in
diff --git a/quic/core/quic_session.cc b/quic/core/quic_session.cc
index 09e5c74..c16b723 100644
--- a/quic/core/quic_session.cc
+++ b/quic/core/quic_session.cc
@@ -834,7 +834,7 @@
// If we haven't received a FIN or RST for this stream, we need to keep track
// of the how many bytes the stream's flow controller believes it has
// received, for accurate connection level flow control accounting.
- const bool had_fin_or_rst = stream->HasFinalReceivedByteOffset();
+ const bool had_fin_or_rst = stream->HasReceivedFinalOffset();
if (!had_fin_or_rst) {
InsertLocallyClosedStreamsHighestOffset(
stream_id, stream->flow_controller()->highest_received_byte_offset());
diff --git a/quic/core/quic_stream.h b/quic/core/quic_stream.h
index c8e5012..55d0bd4 100644
--- a/quic/core/quic_stream.h
+++ b/quic/core/quic_stream.h
@@ -247,9 +247,7 @@
// sent. If this is not true on deletion of the stream object, the session
// must keep track of the stream's byte offset until a definitive final value
// arrives.
- bool HasFinalReceivedByteOffset() const {
- return fin_received_ || rst_received_;
- }
+ bool HasReceivedFinalOffset() const { return fin_received_ || rst_received_; }
// Returns true if the stream has queued data waiting to write.
bool HasBufferedData() const;
diff --git a/quic/core/quic_stream_test.cc b/quic/core/quic_stream_test.cc
index 0cee1fc..74fbcf2 100644
--- a/quic/core/quic_stream_test.cc
+++ b/quic/core/quic_stream_test.cc
@@ -605,38 +605,38 @@
TEST_P(QuicStreamTest, FinalByteOffsetFromFin) {
Initialize();
- EXPECT_FALSE(stream_->HasFinalReceivedByteOffset());
+ EXPECT_FALSE(stream_->HasReceivedFinalOffset());
QuicStreamFrame stream_frame_no_fin(stream_->id(), false, 1234, ".");
stream_->OnStreamFrame(stream_frame_no_fin);
- EXPECT_FALSE(stream_->HasFinalReceivedByteOffset());
+ EXPECT_FALSE(stream_->HasReceivedFinalOffset());
QuicStreamFrame stream_frame_with_fin(stream_->id(), true, 1234, ".");
stream_->OnStreamFrame(stream_frame_with_fin);
- EXPECT_TRUE(stream_->HasFinalReceivedByteOffset());
+ EXPECT_TRUE(stream_->HasReceivedFinalOffset());
}
TEST_P(QuicStreamTest, FinalByteOffsetFromRst) {
Initialize();
- EXPECT_FALSE(stream_->HasFinalReceivedByteOffset());
+ EXPECT_FALSE(stream_->HasReceivedFinalOffset());
QuicRstStreamFrame rst_frame(kInvalidControlFrameId, stream_->id(),
QUIC_STREAM_CANCELLED, 1234);
stream_->OnStreamReset(rst_frame);
- EXPECT_TRUE(stream_->HasFinalReceivedByteOffset());
+ EXPECT_TRUE(stream_->HasReceivedFinalOffset());
}
TEST_P(QuicStreamTest, InvalidFinalByteOffsetFromRst) {
Initialize();
- EXPECT_FALSE(stream_->HasFinalReceivedByteOffset());
+ EXPECT_FALSE(stream_->HasReceivedFinalOffset());
QuicRstStreamFrame rst_frame(kInvalidControlFrameId, stream_->id(),
QUIC_STREAM_CANCELLED, 0xFFFFFFFFFFFF);
// Stream should not accept the frame, and the connection should be closed.
EXPECT_CALL(*connection_,
CloseConnection(QUIC_FLOW_CONTROL_RECEIVED_TOO_MUCH_DATA, _, _));
stream_->OnStreamReset(rst_frame);
- EXPECT_TRUE(stream_->HasFinalReceivedByteOffset());
+ EXPECT_TRUE(stream_->HasReceivedFinalOffset());
stream_->OnClose();
}
@@ -649,7 +649,7 @@
// ignores such a stream frame.
Initialize();
- EXPECT_FALSE(stream_->HasFinalReceivedByteOffset());
+ EXPECT_FALSE(stream_->HasReceivedFinalOffset());
const QuicStreamOffset kByteOffsetExceedingFlowControlWindow =
kInitialSessionFlowControlWindowForTest + 1;
const QuicStreamOffset current_stream_flow_control_offset =
@@ -667,7 +667,7 @@
EXPECT_CALL(*connection_, CloseConnection(_, _, _)).Times(0);
stream_->OnStreamFrame(zero_length_stream_frame_with_fin);
- EXPECT_TRUE(stream_->HasFinalReceivedByteOffset());
+ EXPECT_TRUE(stream_->HasReceivedFinalOffset());
// The flow control receive offset values should not have changed.
EXPECT_EQ(
@@ -724,7 +724,7 @@
QuicStreamFrame stream_frame_with_fin(stream_->id(), true, 1234, ".");
stream_->OnStreamFrame(stream_frame_with_fin);
// The FIN has been received but not consumed.
- EXPECT_TRUE(stream_->HasFinalReceivedByteOffset());
+ EXPECT_TRUE(stream_->HasReceivedFinalOffset());
EXPECT_FALSE(QuicStreamPeer::read_side_closed(stream_));
EXPECT_FALSE(stream_->reading_stopped());
@@ -763,7 +763,7 @@
QuicStreamFrame stream_frame_with_fin(stream_->id(), true, 1234, ".");
stream_->OnStreamFrame(stream_frame_with_fin);
// The FIN has been received but not consumed.
- EXPECT_TRUE(stream_->HasFinalReceivedByteOffset());
+ EXPECT_TRUE(stream_->HasReceivedFinalOffset());
EXPECT_FALSE(QuicStreamPeer::read_side_closed(stream_));
EXPECT_FALSE(stream_->reading_stopped());
@@ -795,7 +795,7 @@
QuicStreamFrame frame2(stream_->id(), true, 0, "End");
stream_->OnStreamFrame(frame2);
EXPECT_TRUE(stream_->fin_received());
- EXPECT_TRUE(stream_->HasFinalReceivedByteOffset());
+ EXPECT_TRUE(stream_->HasReceivedFinalOffset());
}
TEST_P(QuicStreamTest, StreamWaitsForAcks) {