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 "quiche/quic/core/frames/quic_frame.h" 9 #include "quiche/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 QUICHE_EXPORT SessionNotifierInterface { 16 public: ~SessionNotifierInterface()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, 23 QuicTime receive_timestamp) = 0; 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|. Returns true if all 32 // data gets retransmitted. 33 virtual bool RetransmitFrames(const QuicFrames& frames, 34 TransmissionType type) = 0; 35 36 // Returns true if |frame| is outstanding and waiting to be acked. 37 virtual bool IsFrameOutstanding(const QuicFrame& frame) const = 0; 38 39 // Returns true if crypto stream is waiting for acks. 40 virtual bool HasUnackedCryptoData() const = 0; 41 42 // Returns true if any stream is waiting for acks. 43 virtual bool HasUnackedStreamData() const = 0; 44 }; 45 46 } // namespace quic 47 48 #endif // QUICHE_QUIC_CORE_SESSION_NOTIFIER_INTERFACE_H_ 49