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, |
| 22 | QuicTime::Delta ack_delay_time) = 0; |
| 23 | |
| 24 | // Called when |frame| is retransmitted. |
| 25 | virtual void OnStreamFrameRetransmitted(const QuicStreamFrame& frame) = 0; |
| 26 | |
| 27 | // Called when |frame| is considered as lost. |
| 28 | virtual void OnFrameLost(const QuicFrame& frame) = 0; |
| 29 | |
| 30 | // Called to retransmit |frames| with transmission |type|. |
| 31 | virtual void RetransmitFrames(const QuicFrames& frames, |
| 32 | TransmissionType type) = 0; |
| 33 | |
| 34 | // Returns true if |frame| is outstanding and waiting to be acked. |
| 35 | virtual bool IsFrameOutstanding(const QuicFrame& frame) const = 0; |
| 36 | |
| 37 | // Returns true if crypto stream is waiting for acks. |
| 38 | virtual bool HasUnackedCryptoData() const = 0; |
| 39 | }; |
| 40 | |
| 41 | } // namespace quic |
| 42 | |
| 43 | #endif // QUICHE_QUIC_CORE_SESSION_NOTIFIER_INTERFACE_H_ |