| Index: net/quic/core/quic_stream.h
|
| diff --git a/net/quic/core/quic_stream.h b/net/quic/core/quic_stream.h
|
| index df1ebf0277b4f12ccd1faf8bcf625bea7c876008..e88c684be8c4c37837f911fe178f9eb731f1510d 100644
|
| --- a/net/quic/core/quic_stream.h
|
| +++ b/net/quic/core/quic_stream.h
|
| @@ -29,6 +29,7 @@
|
| #include "net/quic/core/quic_packets.h"
|
| #include "net/quic/core/quic_stream_sequencer.h"
|
| #include "net/quic/core/quic_types.h"
|
| +#include "net/quic/core/stream_notifier_interface.h"
|
| #include "net/quic/platform/api/quic_export.h"
|
| #include "net/quic/platform/api/quic_reference_counted.h"
|
| #include "net/quic/platform/api/quic_string_piece.h"
|
| @@ -41,11 +42,11 @@ class QuicStreamPeer;
|
|
|
| class QuicSession;
|
|
|
| -class QUIC_EXPORT_PRIVATE QuicStream {
|
| +class QUIC_EXPORT_PRIVATE QuicStream : public StreamNotifierInterface {
|
| public:
|
| QuicStream(QuicStreamId id, QuicSession* session);
|
|
|
| - virtual ~QuicStream();
|
| + ~QuicStream() override;
|
|
|
| // Not in use currently.
|
| void SetFromConfig();
|
| @@ -91,6 +92,12 @@ class QUIC_EXPORT_PRIVATE QuicStream {
|
| virtual void CloseConnectionWithDetails(QuicErrorCode error,
|
| const std::string& details);
|
|
|
| + // Returns true if this stream is still waiting for acks of sent data.
|
| + // This will return false if all data has been acked, or if the stream
|
| + // is no longer interested in data being acked (which happens when
|
| + // a stream is reset because of an error).
|
| + bool IsWaitingForAcks() const;
|
| +
|
| QuicStreamId id() const { return id_; }
|
|
|
| QuicRstStreamErrorCode stream_error() const { return stream_error_; }
|
| @@ -189,6 +196,11 @@ class QUIC_EXPORT_PRIVATE QuicStream {
|
| // Adds random padding after the fin is consumed for this stream.
|
| void AddRandomPaddingAfterFin();
|
|
|
| + // StreamNotifierInterface methods:
|
| + void OnStreamFrameAcked(const QuicStreamFrame& frame,
|
| + QuicTime::Delta ack_delay_time) override;
|
| + void OnStreamFrameRetransmitted(const QuicStreamFrame& frame) override;
|
| +
|
| protected:
|
| // Sends as many bytes in the first |count| buffers of |iov| to the connection
|
| // as the connection will consume.
|
| @@ -226,6 +238,11 @@ class QUIC_EXPORT_PRIVATE QuicStream {
|
| stream_contributes_to_connection_flow_control_ = false;
|
| }
|
|
|
| + void set_ack_listener(
|
| + QuicReferenceCountedPointer<QuicAckListenerInterface> ack_listener) {
|
| + ack_listener_ = std::move(ack_listener);
|
| + }
|
| +
|
| private:
|
| friend class test::QuicStreamPeer;
|
| friend class QuicStreamUtils;
|
| @@ -270,6 +287,8 @@ class QUIC_EXPORT_PRIVATE QuicStream {
|
| // framing, encryption overhead etc.
|
| uint64_t stream_bytes_read_;
|
| uint64_t stream_bytes_written_;
|
| + // Written bytes which have been acked.
|
| + uint64_t stream_bytes_acked_;
|
|
|
| // Stream error code received from a RstStreamFrame or error code sent by the
|
| // visitor or sequencer in the RstStreamFrame.
|
| @@ -289,6 +308,8 @@ class QUIC_EXPORT_PRIVATE QuicStream {
|
| bool fin_buffered_;
|
| // True if a FIN has been sent to the session.
|
| bool fin_sent_;
|
| + // True if a FIN has been acked.
|
| + bool fin_acked_;
|
|
|
| // True if this stream has received (and the sequencer has accepted) a
|
| // StreamFrame with the FIN set.
|
| @@ -324,6 +345,10 @@ class QUIC_EXPORT_PRIVATE QuicStream {
|
| // stream.
|
| bool add_random_padding_after_fin_;
|
|
|
| + // Ack listener of this stream, and it is notified when any of written bytes
|
| + // are acked.
|
| + QuicReferenceCountedPointer<QuicAckListenerInterface> ack_listener_;
|
| +
|
| DISALLOW_COPY_AND_ASSIGN(QuicStream);
|
| };
|
|
|
|
|