@@ -37,6 +37,20 @@ enum QuicStreamHeadersKind : int {
3737 QUICSTREAM_HEADERS_KIND_TRAILING
3838};
3939
40+ // QuicHeader is a base class for implementing QUIC application
41+ // specific headers. Each type of QUIC application may have
42+ // different internal representations for a header name+value
43+ // pair. QuicApplication implementations that support headers
44+ // per stream must create a specialization of the Header class.
45+ class QuicHeader {
46+ public:
47+ QuicHeader () {}
48+
49+ virtual ~QuicHeader () {}
50+ virtual v8::MaybeLocal<v8::String> GetName (QuicApplication* app) const = 0;
51+ virtual v8::MaybeLocal<v8::String> GetValue (QuicApplication* app) const = 0;
52+ };
53+
4054// QuicStream's are simple data flows that, fortunately, do not
4155// require much. They may be:
4256//
@@ -105,20 +119,6 @@ enum QuicStreamHeadersKind : int {
105119// ngtcp2 level.
106120class QuicStream : public AsyncWrap , public StreamBase {
107121 public:
108- // Header is a base class for implementing QUIC application
109- // specific headers. Each type of QUIC application may have
110- // different internal representations for a header name+value
111- // pair. QuicApplication implementations that support headers
112- // per stream must create a specialization of the Header class.
113- class Header {
114- public:
115- Header () {}
116-
117- virtual ~Header () {}
118- virtual v8::MaybeLocal<v8::String> GetName (QuicApplication* app) const = 0;
119- virtual v8::MaybeLocal<v8::String> GetValue (QuicApplication* app) const = 0;
120- };
121-
122122 enum QuicStreamStates : uint32_t {
123123 // QuicStream is fully open. Readable and Writable
124124 QUICSTREAM_FLAG_INITIAL = 0x0 ,
@@ -361,7 +361,7 @@ class QuicStream : public AsyncWrap, public StreamBase {
361361 // Returns false if the header cannot be added. This will
362362 // typically only happen if a maximimum number of headers
363363 // has been reached.
364- bool AddHeader (std::unique_ptr<Header > header);
364+ bool AddHeader (std::unique_ptr<QuicHeader > header);
365365 void EndHeaders ();
366366
367367 // Sets the kind of headers currently being processed.
@@ -428,7 +428,7 @@ class QuicStream : public AsyncWrap, public StreamBase {
428428 size_t available_outbound_length_ = 0 ;
429429 size_t inbound_consumed_data_while_paused_ = 0 ;
430430
431- std::vector<std::unique_ptr<Header >> headers_;
431+ std::vector<std::unique_ptr<QuicHeader >> headers_;
432432 QuicStreamHeadersKind headers_kind_;
433433
434434 struct stream_stats {
0 commit comments