Refactor QPACK encoder and decoder stream errors.
This CL introduces some unused arguments. The intention is to do as much
refactoring as possible before cl/337315008, with the goal to make both CLs
easier to review.
No behavioral change in production code.
Add some extra information to logs in QPACK roundtrip fuzzer and offline
decoder.
Add QpackEncoderStreamReceiverTest.InvalidHuffmanEncoding and
QpackInstructionDecoderTest.StringLiteralTooLong.
PiperOrigin-RevId: 337654909
Change-Id: Ie7fa54abf264d6906ffd63ef886184c70df3d08d
diff --git a/quic/core/qpack/qpack_instruction_decoder.h b/quic/core/qpack/qpack_instruction_decoder.h
index c6df1f3..759c8f0 100644
--- a/quic/core/qpack/qpack_instruction_decoder.h
+++ b/quic/core/qpack/qpack_instruction_decoder.h
@@ -42,7 +42,8 @@
// No more data is processed afterwards.
// Implementations are allowed to destroy the QpackInstructionDecoder
// instance synchronously.
- virtual void OnError(absl::string_view error_message) = 0;
+ virtual void OnInstructionDecodingError(
+ absl::string_view error_message) = 0;
};
// Both |*language| and |*delegate| must outlive this object.
@@ -53,7 +54,8 @@
// Provide a data fragment to decode. Must not be called after an error has
// occurred. Must not be called with empty |data|. Return true on success,
- // false on error (in which case Delegate::OnError() is called synchronously).
+ // false on error (in which case Delegate::OnInstructionDecodingError() is
+ // called synchronously).
bool Decode(absl::string_view data);
// Returns true if no decoding has taken place yet or if the last instruction
@@ -107,7 +109,7 @@
// Returns a pointer to an element of |*language_|.
const QpackInstruction* LookupOpcode(uint8_t byte) const;
- // Stops decoding and calls Delegate::OnError().
+ // Stops decoding and calls Delegate::OnInstructionDecodingError().
void OnError(absl::string_view error_message);
// Describes the language used for decoding.