http2: multiple smaller code cleanups · nodejs/node@29efb02 · GitHub
Skip to content

Commit 29efb02

Browse files
jasnellMylesBorins
authored andcommitted
http2: multiple smaller code cleanups
* Add Http2Priority utility class * Reduces some code duplication * Other small minor cleanups PR-URL: #16764 Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
1 parent dc14c25 commit 29efb02

3 files changed

Lines changed: 57 additions & 72 deletions

File tree

src/node_http2.cc

Lines changed: 21 additions & 31 deletions

src/node_http2.h

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -369,6 +369,20 @@ class Http2Settings {
369369
MaybeStackBuffer<nghttp2_settings_entry, IDX_SETTINGS_COUNT> entries_;
370370
};
371371

372+
class Http2Priority {
373+
public:
374+
Http2Priority(Environment* env,
375+
Local<Value> parent,
376+
Local<Value> weight,
377+
Local<Value> exclusive);
378+
379+
nghttp2_priority_spec* operator*() {
380+
return &spec;
381+
}
382+
private:
383+
nghttp2_priority_spec spec;
384+
};
385+
372386
class Http2Session : public AsyncWrap,
373387
public StreamBase,
374388
public Nghttp2Session {

src/node_http2_core-inl.h

Lines changed: 22 additions & 41 deletions

0 commit comments

Comments
 (0)