| Index: net/quic/core/quic_session.h
|
| diff --git a/net/quic/core/quic_session.h b/net/quic/core/quic_session.h
|
| index 403f0e58cce598f3b4206061fa3d90897ae962a6..d70e4bdf6349ec74201df719d4d2fb37c55e05b2 100644
|
| --- a/net/quic/core/quic_session.h
|
| +++ b/net/quic/core/quic_session.h
|
| @@ -22,6 +22,7 @@
|
| #include "net/quic/core/quic_packets.h"
|
| #include "net/quic/core/quic_stream.h"
|
| #include "net/quic/core/quic_write_blocked_list.h"
|
| +#include "net/quic/core/stream_notifier_interface.h"
|
| #include "net/quic/platform/api/quic_containers.h"
|
| #include "net/quic/platform/api/quic_export.h"
|
| #include "net/quic/platform/api/quic_socket_address.h"
|
| @@ -36,7 +37,8 @@ namespace test {
|
| class QuicSessionPeer;
|
| } // namespace test
|
|
|
| -class QUIC_EXPORT_PRIVATE QuicSession : public QuicConnectionVisitorInterface {
|
| +class QUIC_EXPORT_PRIVATE QuicSession : public QuicConnectionVisitorInterface,
|
| + public StreamNotifierInterface {
|
| public:
|
| // An interface from the session to the entity owning the session.
|
| // This lets the session notify its owner (the Dispatcher) when the connection
|
| @@ -107,6 +109,11 @@ class QUIC_EXPORT_PRIVATE QuicSession : public QuicConnectionVisitorInterface {
|
| bool HasOpenDynamicStreams() const override;
|
| void OnPathDegrading() override;
|
|
|
| + // StreamNotifierInterface methods:
|
| + void OnStreamFrameAcked(const QuicStreamFrame& frame,
|
| + QuicTime::Delta ack_delay_time) override;
|
| + void OnStreamFrameRetransmitted(const QuicStreamFrame& frame) override;
|
| +
|
| // Called on every incoming packet. Passes |packet| through to |connection_|.
|
| virtual void ProcessUdpPacket(const QuicSocketAddress& self_address,
|
| const QuicSocketAddress& peer_address,
|
| @@ -208,6 +215,11 @@ class QUIC_EXPORT_PRIVATE QuicSession : public QuicConnectionVisitorInterface {
|
| // WINDOW_UPDATE arrives.
|
| void MarkConnectionLevelWriteBlocked(QuicStreamId id);
|
|
|
| + // Called when stream |id| is done waiting for acks either because all data
|
| + // gets acked or is not interested in data being acked (which happens when
|
| + // a stream is reset because of an error).
|
| + void OnStreamDoneWaitingForAcks(QuicStreamId id);
|
| +
|
| // Returns true if the session has data to be sent, either queued in the
|
| // connection, or in a write-blocked stream.
|
| bool HasDataToWrite() const;
|
| @@ -254,6 +266,8 @@ class QUIC_EXPORT_PRIVATE QuicSession : public QuicConnectionVisitorInterface {
|
| respect_goaway_ = respect_goaway;
|
| }
|
|
|
| + bool use_stream_notifier() const { return use_stream_notifier_; }
|
| +
|
| protected:
|
| using StaticStreamMap = QuicSmallMap<QuicStreamId, QuicStream*, 2>;
|
|
|
| @@ -262,6 +276,9 @@ class QUIC_EXPORT_PRIVATE QuicSession : public QuicConnectionVisitorInterface {
|
|
|
| using ClosedStreams = std::vector<std::unique_ptr<QuicStream>>;
|
|
|
| + using ZombieStreamMap =
|
| + QuicSmallMap<QuicStreamId, std::unique_ptr<QuicStream>, 10>;
|
| +
|
| // TODO(ckrasic) - For all *DynamicStream2 below, rename after
|
| // quic_reloadable_flag_quic_refactor_stream_creation is deprecated.
|
|
|
| @@ -347,6 +364,8 @@ class QUIC_EXPORT_PRIVATE QuicSession : public QuicConnectionVisitorInterface {
|
|
|
| ClosedStreams* closed_streams() { return &closed_streams_; }
|
|
|
| + const ZombieStreamMap& zombie_streams() const { return zombie_streams_; }
|
| +
|
| void set_max_open_incoming_streams(size_t max_open_incoming_streams);
|
| void set_max_open_outgoing_streams(size_t max_open_outgoing_streams);
|
|
|
| @@ -416,6 +435,10 @@ class QUIC_EXPORT_PRIVATE QuicSession : public QuicConnectionVisitorInterface {
|
| // starting with larger flow control receive windows.
|
| void AdjustInitialFlowControlWindows(size_t stream_window);
|
|
|
| + // Find stream with |id|, returns nullptr if the stream does not exist or
|
| + // closed.
|
| + QuicStream* GetStream(QuicStreamId id) const;
|
| +
|
| // Keep track of highest received byte offset of locally closed streams, while
|
| // waiting for a definitive final highest offset from the peer.
|
| std::map<QuicStreamId, QuicStreamOffset>
|
| @@ -428,6 +451,10 @@ class QUIC_EXPORT_PRIVATE QuicSession : public QuicConnectionVisitorInterface {
|
|
|
| ClosedStreams closed_streams_;
|
|
|
| + // Streams which are closed, but need to be kept alive. Currently, the only
|
| + // reason is the stream's sent data (including FIN) does not get fully acked.
|
| + ZombieStreamMap zombie_streams_;
|
| +
|
| QuicConfig config_;
|
|
|
| // The maximum number of outgoing streams this connection can open.
|
| @@ -485,6 +512,9 @@ class QUIC_EXPORT_PRIVATE QuicSession : public QuicConnectionVisitorInterface {
|
| // chance they will fail.
|
| bool respect_goaway_;
|
|
|
| + // This session is notified on every ack or loss.
|
| + const bool use_stream_notifier_;
|
| +
|
| DISALLOW_COPY_AND_ASSIGN(QuicSession);
|
| };
|
|
|
|
|