Remove HttpDecoder::has_payload().
Instead of polling has_payload(), query QuicSpdyStreamBodyBuffer::HasBytesToRead().
Note the subtle change in behavior: OnBodyAvailable() will be called even if there
is no new payload decoded but the consumer has not read all the buffer previously.
Also add DCHECKs to QuicSpdyStream() methods that are only supposed to be called
in v99.
gfe-relnote: n/a. Other than adding a DCHECK, change behavior in QUIC v99 only. Not flag protected.
PiperOrigin-RevId: 238306060
Change-Id: I044ea4c0e49064c5193958b44c6cee61eb15e08f
diff --git a/quic/core/http/http_decoder.cc b/quic/core/http/http_decoder.cc
index 55879d0..34e4342 100644
--- a/quic/core/http/http_decoder.cc
+++ b/quic/core/http/http_decoder.cc
@@ -35,13 +35,11 @@
current_frame_length_(0),
remaining_frame_length_(0),
error_(QUIC_NO_ERROR),
- error_detail_(""),
- has_payload_(false) {}
+ error_detail_("") {}
HttpDecoder::~HttpDecoder() {}
QuicByteCount HttpDecoder::ProcessInput(const char* data, QuicByteCount len) {
- has_payload_ = false;
QuicDataReader reader(data, len);
while (error_ == QUIC_NO_ERROR && reader.BytesRemaining() != 0) {
switch (state_) {
@@ -112,7 +110,6 @@
RaiseError(QUIC_INTERNAL_ERROR, "Unable to read data");
return;
}
- has_payload_ = true;
visitor_->OnDataFramePayload(payload);
remaining_frame_length_ -= payload.length();
if (remaining_frame_length_ == 0) {