summaryrefslogtreecommitdiff
path: root/chromium/net/quic/quartc/quartc_stream.h
blob: 188345104215c6c39d347854aa50eb759e2ab35f (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
48
49
// 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 NET_QUIC_QUARTC_QUARTC_STREAM_H_
#define NET_QUIC_QUARTC_QUARTC_STREAM_H_

#include "net/quic/core/quic_session.h"
#include "net/quic/core/quic_stream.h"
#include "net/quic/quartc/quartc_stream_interface.h"

namespace net {

// Implements a QuartcStreamInterface using a QuicStream.
class QuartcStream : public QuicStream, public QuartcStreamInterface {
 public:
  QuartcStream(QuicStreamId id, QuicSession* session);

  ~QuartcStream() override;

  // QuicStream overrides.
  void OnDataAvailable() override;

  void OnClose() override;

  void OnCanWrite() override;

  // QuartcStreamInterface overrides.
  uint32_t stream_id() override;

  uint64_t buffered_amount() override;

  bool fin_sent() override;

  void Write(const char* data,
             size_t size,
             const WriteParameters& param) override;

  void Close() override;

  void SetDelegate(QuartcStreamInterface::Delegate* delegate) override;

 private:
  QuartcStreamInterface::Delegate* delegate_ = nullptr;
};

}  // namespace net

#endif  // NET_QUIC_QUARTC_QUARTC_STREAM_H_