| 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..8fd03315a6d1e52de739b5292e3ff68abd3b153c 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();
|
| @@ -125,6 +126,8 @@ class QUIC_EXPORT_PRIVATE QuicStream {
|
| void set_rst_received(bool rst_received) { rst_received_ = rst_received; }
|
| void set_stream_error(QuicRstStreamErrorCode error) { stream_error_ = error; }
|
|
|
| + bool is_deletable() const { return is_deletable_; }
|
| +
|
| // Adjust the flow control window according to new offset in |frame|.
|
| virtual void OnWindowUpdateFrame(const QuicWindowUpdateFrame& frame);
|
|
|
| @@ -189,6 +192,15 @@ class QUIC_EXPORT_PRIVATE QuicStream {
|
| // Adds random padding after the fin is consumed for this stream.
|
| void AddRandomPaddingAfterFin();
|
|
|
| + // Sets this stream as deletable. Delete this stream from zombie stream map if
|
| + // exists.
|
| + void SetIsDeletable(bool is_deletable);
|
| +
|
| + // 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.
|
| @@ -302,6 +323,11 @@ class QUIC_EXPORT_PRIVATE QuicStream {
|
| // True if this stream has received a RST_STREAM frame.
|
| bool rst_received_;
|
|
|
| + // True if this stream object may be deleted. Currently, this means this
|
| + // stream does not have unacked data (including FIN). Please note, this stream
|
| + // may not finish sending.
|
| + bool is_deletable_;
|
| +
|
| // Tracks if the session this stream is running under was created by a
|
| // server or a client.
|
| Perspective perspective_;
|
| @@ -324,6 +350,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);
|
| };
|
|
|
|
|