http2: cleanup and refactoring of http2 internals by jasnell · Pull Request #32884 · nodejs/node

added 17 commits

April 16, 2020 10:51
The error constants were just doing some weird things. Cleanup
and improve maintainability.

Signed-off-by: James M Snell <jasnell@gmail.com>
Signed-off-by: James M Snell <jasnell@gmail.com>
Signed-off-by: James M Snell <jasnell@gmail.com>
Use snake_case for getters and setters at c++ level,
avoid unnecessary use of enums,
use consistent style for exported vs. internal constants,
avoid unnecessary memory info reporting,
use setters/getters for flags_ for improved code readability

Signed-off-by: James M Snell <jasnell@gmail.com>
Signed-off-by: James M Snell <jasnell@gmail.com>
Signed-off-by: James M Snell <jasnell@gmail.com>
Signed-off-by: James M Snell <jasnell@gmail.com>
The **session and **stream syntax for getting the underlying
nghttp2 pointers is not ideal for readability

Signed-off-by: James M Snell <jasnell@gmail.com>
Signed-off-by: James M Snell <jasnell@gmail.com>
Signed-off-by: James M Snell <jasnell@gmail.com>
Signed-off-by: James M Snell <jasnell@gmail.com>
Signed-off-by: James M Snell <jasnell@gmail.com>
Signed-off-by: James M Snell <jasnell@gmail.com>
* Use an AllocatedBuffer instead of MaybeStackBuffer
* Use a const reference instead of pointer

Signed-off-by: James M Snell <jasnell@gmail.com>
Signed-off-by: James M Snell <jasnell@gmail.com>
Signed-off-by: James M Snell <jasnell@gmail.com>
Signed-off-by: James M Snell <jasnell@gmail.com>

@nodejs-github-bot nodejs-github-bot added c++

Issues and PRs that require attention from people who are familiar with C++.

lib / src

Issues and PRs related to general changes in the lib or src directory.

labels

Apr 16, 2020

addaleax

@jasnell

mcollina

@jasnell jasnell added the author ready

PRs that have at least one approval, no pending requests for changes, and a CI started.

label

Apr 21, 2020

jasnell added a commit that referenced this pull request

Apr 21, 2020
* cleanup constants in http2 binding
  The error constants were just doing some weird things. Cleanup
  and improve maintainability.
* simplify settings to reduce duplicate code
* improve style consistency and correctness
  Use snake_case for getters and setters at c++ level,
  avoid unnecessary use of enums,
  use consistent style for exported vs. internal constants,
  avoid unnecessary memory info reporting,
  use setters/getters for flags_ for improved code readability
* make EmitStatistics function private
* un-nest Http2Settings and Http2Ping
* refactoring and cleanup of Http2Settings and Http2Ping
* avoid ** syntax for readability
  The **session and **stream syntax for getting the underlying
  nghttp2 pointers is not ideal for readability
* use const references for Http2Priority
* remove unnecessary GetStream function
* refactor Http2Scope to use BaseObjectPtr
* move utility function to anonymous namespace
* refactor and simplify Origins
* Use an AllocatedBuffer instead of MaybeStackBuffer
* Use a const reference instead of pointer
* use BaseObjectPtr for Http2Streams map
* move MemoryInfo impl to cc

Signed-off-by: James M Snell <jasnell@gmail.com>

PR-URL: #32884
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>

BethGriggs pushed a commit that referenced this pull request

Apr 27, 2020
* cleanup constants in http2 binding
  The error constants were just doing some weird things. Cleanup
  and improve maintainability.
* simplify settings to reduce duplicate code
* improve style consistency and correctness
  Use snake_case for getters and setters at c++ level,
  avoid unnecessary use of enums,
  use consistent style for exported vs. internal constants,
  avoid unnecessary memory info reporting,
  use setters/getters for flags_ for improved code readability
* make EmitStatistics function private
* un-nest Http2Settings and Http2Ping
* refactoring and cleanup of Http2Settings and Http2Ping
* avoid ** syntax for readability
  The **session and **stream syntax for getting the underlying
  nghttp2 pointers is not ideal for readability
* use const references for Http2Priority
* remove unnecessary GetStream function
* refactor Http2Scope to use BaseObjectPtr
* move utility function to anonymous namespace
* refactor and simplify Origins
* Use an AllocatedBuffer instead of MaybeStackBuffer
* Use a const reference instead of pointer
* use BaseObjectPtr for Http2Streams map
* move MemoryInfo impl to cc

Signed-off-by: James M Snell <jasnell@gmail.com>

PR-URL: #32884
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>