summaryrefslogtreecommitdiff
path: root/chromium/net/third_party/quiche/src/quic/core/session_notifier_interface.h
blob: fc16b63407b3b62594b2e9b078377d0541cdff12 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
// Copyright (c) 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef QUICHE_QUIC_CORE_SESSION_NOTIFIER_INTERFACE_H_
#define QUICHE_QUIC_CORE_SESSION_NOTIFIER_INTERFACE_H_

#include "quic/core/frames/quic_frame.h"
#include "quic/core/quic_time.h"

namespace quic {

// Pure virtual class to be notified when a packet containing a frame is acked
// or lost.
class QUIC_EXPORT_PRIVATE SessionNotifierInterface {
 public:
  virtual ~SessionNotifierInterface() {}

  // Called when |frame| is acked. Returns true if any new data gets acked,
  // returns false otherwise.
  virtual bool OnFrameAcked(const QuicFrame& frame,
                            QuicTime::Delta ack_delay_time,
                            QuicTime receive_timestamp) = 0;

  // Called when |frame| is retransmitted.
  virtual void OnStreamFrameRetransmitted(const QuicStreamFrame& frame) = 0;

  // Called when |frame| is considered as lost.
  virtual void OnFrameLost(const QuicFrame& frame) = 0;

  // Called to retransmit |frames| with transmission |type|.
  virtual void RetransmitFrames(const QuicFrames& frames,
                                TransmissionType type) = 0;

  // Returns true if |frame| is outstanding and waiting to be acked.
  virtual bool IsFrameOutstanding(const QuicFrame& frame) const = 0;

  // Returns true if crypto stream is waiting for acks.
  virtual bool HasUnackedCryptoData() const = 0;

  // Returns true if any stream is waiting for acks.
  virtual bool HasUnackedStreamData() const = 0;
};

}  // namespace quic

#endif  // QUICHE_QUIC_CORE_SESSION_NOTIFIER_INTERFACE_H_