blob: 4fb8b50867af0440b702462b04816139805c96f1 [file] [log] [blame]
QUICHE teama6ef0a62019-03-07 20:34:33 -05001// 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
11namespace quic {
12
13// Pure virtual class to be notified when a packet containing a frame is acked
14// or lost.
15class 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 team9467db02019-05-30 09:38:45 -070022 QuicTime::Delta ack_delay_time,
23 QuicTime receive_timestamp) = 0;
QUICHE teama6ef0a62019-03-07 20:34:33 -050024
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;
zhongyi1b2f7832019-06-14 13:31:34 -070040
41 // Returns true if any stream is waiting for acks.
42 virtual bool HasUnackedStreamData() const = 0;
fayang9a863cf2020-01-16 14:12:11 -080043
44 // Returns current handshake state.
45 virtual HandshakeState GetHandshakeState() const = 0;
QUICHE teama6ef0a62019-03-07 20:34:33 -050046};
47
48} // namespace quic
49
50#endif // QUICHE_QUIC_CORE_SESSION_NOTIFIER_INTERFACE_H_