Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

src: refactor binding data for deserialization support #37112

Closed
wants to merge 2 commits into from

Conversation

joyeecheung
Copy link
Member

@joyeecheung joyeecheung commented Jan 28, 2021

Refs: #36943
Refs: #35711

src: rename binding_data_name to type_name in BindingData

Previously, this was a per-class string constant for BindingData
which is used as keys for identifying these objects in the binding
data map. These are just type names of the BindingData.
This patch renames the variable to type_name so that
we can generalize this constant for other BaseObjects and use
it for debugging and logging the types of other BaseObjects.

src: refactor v8 binding

  1. Put the v8 binding data class into a header so we can reuse
    the class definition during deserialization.
  2. Put the v8 binding code into node::v8_utils namespace for
    clarity.
  3. Move the binding data property initialization into its
    constructor so that we can reuse it during deserialization
  4. Reorder the v8 binding initialization so that we don't
    unnecessarily initialize the properties in a loop

@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 Jan 28, 2021
@nodejs-github-bot
Copy link
Collaborator

Previously, this was a per-class string constant for BindingData
which is used as keys for identifying these objects in the binding
data map. These are just type names of the BindingData.
This patch renames the variable to type_name so that
we can generalize this constant for other BaseObjects and use
it for debugging and logging the types of other BaseObjects.
1. Put the v8 binding data class into a header so we can reuse
  the class definition during deserialization.
2. Put the v8 binding code into node::v8_utils namespace for
  clarity.
3. Move the binding data property initialization into its
  constructor so that we can reuse it during deserialization
4. Reorder the v8 binding initialization so that we don't
  unnecessarily initialize the properties in a loop
@joyeecheung
Copy link
Member Author

Rebased after quic was removed

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@joyeecheung
Copy link
Member Author

joyeecheung commented Feb 8, 2021

Landed in b346cd1...7e6bb66

@joyeecheung joyeecheung closed this Feb 8, 2021
joyeecheung added a commit that referenced this pull request Feb 8, 2021
Previously, this was a per-class string constant for BindingData
which is used as keys for identifying these objects in the binding
data map. These are just type names of the BindingData.
This patch renames the variable to type_name so that
we can generalize this constant for other BaseObjects and use
it for debugging and logging the types of other BaseObjects.

PR-URL: #37112
Refs: #36943
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
joyeecheung added a commit that referenced this pull request Feb 8, 2021
1. Put the v8 binding data class into a header so we can reuse
  the class definition during deserialization.
2. Put the v8 binding code into node::v8_utils namespace for
  clarity.
3. Move the binding data property initialization into its
  constructor so that we can reuse it during deserialization
4. Reorder the v8 binding initialization so that we don't
  unnecessarily initialize the properties in a loop

PR-URL: #37112
Refs: #36943
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
danielleadams pushed a commit that referenced this pull request Feb 16, 2021
Previously, this was a per-class string constant for BindingData
which is used as keys for identifying these objects in the binding
data map. These are just type names of the BindingData.
This patch renames the variable to type_name so that
we can generalize this constant for other BaseObjects and use
it for debugging and logging the types of other BaseObjects.

PR-URL: #37112
Refs: #36943
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
danielleadams pushed a commit that referenced this pull request Feb 16, 2021
1. Put the v8 binding data class into a header so we can reuse
  the class definition during deserialization.
2. Put the v8 binding code into node::v8_utils namespace for
  clarity.
3. Move the binding data property initialization into its
  constructor so that we can reuse it during deserialization
4. Reorder the v8 binding initialization so that we don't
  unnecessarily initialize the properties in a loop

PR-URL: #37112
Refs: #36943
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
This was referenced Feb 16, 2021
targos pushed a commit that referenced this pull request May 1, 2021
Previously, this was a per-class string constant for BindingData
which is used as keys for identifying these objects in the binding
data map. These are just type names of the BindingData.
This patch renames the variable to type_name so that
we can generalize this constant for other BaseObjects and use
it for debugging and logging the types of other BaseObjects.

PR-URL: #37112
Refs: #36943
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
targos pushed a commit that referenced this pull request May 1, 2021
1. Put the v8 binding data class into a header so we can reuse
  the class definition during deserialization.
2. Put the v8 binding code into node::v8_utils namespace for
  clarity.
3. Move the binding data property initialization into its
  constructor so that we can reuse it during deserialization
4. Reorder the v8 binding initialization so that we don't
  unnecessarily initialize the properties in a loop

PR-URL: #37112
Refs: #36943
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
@danielleadams danielleadams mentioned this pull request May 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants