blob: 43a26e93c81d1de133924ae371bdf15743260475 [file] [log] [blame]
QUICHE teamcf9d4ed2021-03-08 15:13:32 -08001#ifndef QUICHE_HTTP2_ADAPTER_HTTP2_SESSION_H_
2#define QUICHE_HTTP2_ADAPTER_HTTP2_SESSION_H_
3
4#include <cstdint>
5
6#include "absl/strings/string_view.h"
7#include "http2/adapter/http2_protocol.h"
8
9namespace http2 {
10namespace adapter {
11
12struct Http2SessionCallbacks {};
13
14// A class to represent the state of a single HTTP/2 connection.
15class Http2Session {
16 public:
17 Http2Session() = default;
18 virtual ~Http2Session() {}
19
20 virtual ssize_t ProcessBytes(absl::string_view bytes) = 0;
21
22 virtual int Consume(Http2StreamId stream_id, size_t num_bytes) = 0;
23
QUICHE team7ee21fc2021-03-24 07:22:07 -070024 virtual bool want_read() const = 0;
25 virtual bool want_write() const = 0;
26 virtual int GetRemoteWindowSize() const = 0;
QUICHE teamcf9d4ed2021-03-08 15:13:32 -080027};
28
QUICHE team62eeb202021-04-08 14:57:00 -070029enum class Perspective {
30 kClient,
31 kServer,
QUICHE teamcf9d4ed2021-03-08 15:13:32 -080032};
33
34} // namespace adapter
35} // namespace http2
36
37#endif // QUICHE_HTTP2_ADAPTER_HTTP2_SESSION_H_