Merge QpackEncoderStreamSender::Delegate and QpackDecoderStreamSender::Delegate
into a single delegate interface called QpackUnidirectionalStreamSenderDelegate. The new interface is inherited by QpackSendStream.
Before this change, Qpack encoder/decoder stream sender will call the spdy session and the session is responsible for finding the correct stream and write instructions.
Now Qpack encoder/decoder stream sender can access Qpack streams to write instructions directly.
gfe-relnote: v99 only, not used in prod.
PiperOrigin-RevId: 254247942
Change-Id: Iec378d412396d12d51b63843d45630b09b301b69
diff --git a/quic/core/qpack/qpack_encoder_stream_sender.h b/quic/core/qpack/qpack_encoder_stream_sender.h
index ad34568..e395b6d 100644
--- a/quic/core/qpack/qpack_encoder_stream_sender.h
+++ b/quic/core/qpack/qpack_encoder_stream_sender.h
@@ -8,6 +8,7 @@
#include <cstdint>
#include "net/third_party/quiche/src/quic/core/qpack/qpack_instruction_encoder.h"
+#include "net/third_party/quiche/src/quic/core/qpack/qpack_stream_sender_delegate.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_export.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_string_piece.h"
@@ -16,19 +17,7 @@
// This class serializes instructions for transmission on the encoder stream.
class QUIC_EXPORT_PRIVATE QpackEncoderStreamSender {
public:
- // An interface for handling encoded data.
- class Delegate {
- public:
- virtual ~Delegate() = default;
-
- // Encoded |data| is ready to be written on the encoder stream.
- // WriteEncoderStreamData() is called exactly once for each instruction.
- // |data| contains the entire encoded instruction and it is guaranteed to be
- // not empty.
- virtual void WriteEncoderStreamData(QuicStringPiece data) = 0;
- };
-
- explicit QpackEncoderStreamSender(Delegate* delegate);
+ explicit QpackEncoderStreamSender(QpackStreamSenderDelegate* delegate);
QpackEncoderStreamSender() = delete;
QpackEncoderStreamSender(const QpackEncoderStreamSender&) = delete;
QpackEncoderStreamSender& operator=(const QpackEncoderStreamSender&) = delete;
@@ -49,7 +38,7 @@
void SendSetDynamicTableCapacity(uint64_t capacity);
private:
- Delegate* const delegate_;
+ QpackStreamSenderDelegate* const delegate_;
QpackInstructionEncoder instruction_encoder_;
};