QUICHE team | a6ef0a6 | 2019-03-07 20:34:33 -0500 | [diff] [blame] | 1 | // Copyright (c) 2017 The Chromium Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #ifndef QUICHE_QUIC_CORE_SESSION_NOTIFIER_INTERFACE_H_ |
| 6 | #define QUICHE_QUIC_CORE_SESSION_NOTIFIER_INTERFACE_H_ |
| 7 | |
| 8 | #include "net/third_party/quiche/src/quic/core/frames/quic_frame.h" |
| 9 | #include "net/third_party/quiche/src/quic/core/quic_time.h" |
| 10 | |
| 11 | namespace quic { |
| 12 | |
| 13 | // Pure virtual class to be notified when a packet containing a frame is acked |
| 14 | // or lost. |
| 15 | class QUIC_EXPORT_PRIVATE SessionNotifierInterface { |
| 16 | public: |
| 17 | virtual ~SessionNotifierInterface() {} |
| 18 | |
| 19 | // Called when |frame| is acked. Returns true if any new data gets acked, |
| 20 | // returns false otherwise. |
| 21 | virtual bool OnFrameAcked(const QuicFrame& frame, |
QUICHE team | 9467db0 | 2019-05-30 09:38:45 -0700 | [diff] [blame] | 22 | QuicTime::Delta ack_delay_time, |
| 23 | QuicTime receive_timestamp) = 0; |
QUICHE team | a6ef0a6 | 2019-03-07 20:34:33 -0500 | [diff] [blame] | 24 | |
| 25 | // Called when |frame| is retransmitted. |
| 26 | virtual void OnStreamFrameRetransmitted(const QuicStreamFrame& frame) = 0; |
| 27 | |
| 28 | // Called when |frame| is considered as lost. |
| 29 | virtual void OnFrameLost(const QuicFrame& frame) = 0; |
| 30 | |
| 31 | // Called to retransmit |frames| with transmission |type|. |
| 32 | virtual void RetransmitFrames(const QuicFrames& frames, |
| 33 | TransmissionType type) = 0; |
| 34 | |
| 35 | // Returns true if |frame| is outstanding and waiting to be acked. |
| 36 | virtual bool IsFrameOutstanding(const QuicFrame& frame) const = 0; |
| 37 | |
| 38 | // Returns true if crypto stream is waiting for acks. |
| 39 | virtual bool HasUnackedCryptoData() const = 0; |
zhongyi | 1b2f783 | 2019-06-14 13:31:34 -0700 | [diff] [blame] | 40 | |
| 41 | // Returns true if any stream is waiting for acks. |
| 42 | virtual bool HasUnackedStreamData() const = 0; |
fayang | 9a863cf | 2020-01-16 14:12:11 -0800 | [diff] [blame] | 43 | |
| 44 | // Returns current handshake state. |
| 45 | virtual HandshakeState GetHandshakeState() const = 0; |
QUICHE team | a6ef0a6 | 2019-03-07 20:34:33 -0500 | [diff] [blame] | 46 | }; |
| 47 | |
| 48 | } // namespace quic |
| 49 | |
| 50 | #endif // QUICHE_QUIC_CORE_SESSION_NOTIFIER_INTERFACE_H_ |