Uh oh!
There was an error while loading. Please reload this page.
Extract base64 encoding/decoding code into headers - #6910
Conversation
/cc @nodejs/ctc Is this an API we want to support? I'm leaning towards -1 but more like -0.5 I guess.... EDIT: Thinking about this more I move my vote to -1 ;-) |
indutny
commented
May 21, 2016
-1 from me as well, this is an implementation detail, not an API. |
ofrobots
commented
May 21, 2016
This looks like a refactoring of code so base64 could be used in other parts of Node core. This is not a new API. Did I miss something? |
ofrobots
commented
May 21, 2016
@eugeneo The commit message should be formatted according to the commit guidelines: https://github.com/nodejs/node/blob/master/CONTRIBUTING.md |
@ofrobots This PR moves the code from the existing |
ofrobots
commented
May 21, 2016
But I could use the same 'API' by including |
indutny
commented
May 21, 2016
@ofrobots this doesn't really feat into the concept of API, IMO. Node.js is about JS VM, OS bindings, and the rest. |
There was a problem hiding this comment.
Can you leave the table itself in string_bytes.cc? Just drop the static keyword and declare it here. Maybe add [256] so there is no confusion about its size.
bnoordhuis
commented
May 21, 2016
mscdex
commented
May 21, 2016
I somehow missed the PR link the first time. I rescind my -1 vote. |
eugeneo
commented
May 23, 2016
I updated the commit message & moved the array. Please take another look. |
bnoordhuis
commented
May 23, 2016
indutny
commented
May 23, 2016
If it is not public - should we add something like this to the header? Sorry, but not LGTM to me yet. |
Node already has support for base64 encoding and decoding that is not visible outside the string_bytes.cc file. Our work on providing a support for the Chrome inspector protocol (#6792) requires base64 encoding support. Rather then introducing a second copy of the base64 encoder, we suggest moving this code into a separate header.
eugeneo
commented
May 23, 2016
@indutny I've added the condition to a header. Please note that it looks like there are no other headers with such directives - e.g. node-internal.h does not have the condition, it is node.h that conditionally includes node-internal.h. |
indutny
commented
May 23, 2016
@eugeneo thank you! I know that it is not present anywhere else, but if we don't want this header to be used in general user addons, we have to protect it somehow! |
indutny
commented
May 23, 2016
LGTM |
ofrobots
commented
May 23, 2016
LGTM. New CI: https://ci.nodejs.org/job/node-test-pull-request/2752/ |
Node already has support for base64 encoding and decoding that is not visible outside the string_bytes.cc file. Our work on providing a support for the Chrome inspector protocol (#6792) requires base64 encoding support. Rather then introducing a second copy of the base64 encoder, we suggest moving this code into a separate header. PR-URL: #6910 Reviewed-By: bnoordhuis - Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: indutny - Fedor Indutny <fedor.indutny@gmail.com> Reviewed-By: ofrobots - Ali Ijaz Sheikh <ofrobots@google.com>
ofrobots
commented
May 23, 2016
Landed as 706e699. |
bnoordhuis
commented
May 24, 2016
bnoordhuis
commented
May 24, 2016
For consistency with the newly added src/base64.h header, check that NODE_WANT_INTERNALS is defined and set in internal headers. PR-URL: nodejs#6948 Refs: nodejs#6910 Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Node already has support for base64 encoding and decoding that is not visible outside the string_bytes.cc file. Our work on providing a support for the Chrome inspector protocol (nodejs#6792) requires base64 encoding support. Rather then introducing a second copy of the base64 encoder, we suggest moving this code into a separate header. PR-URL: nodejs#6910 Reviewed-By: bnoordhuis - Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: indutny - Fedor Indutny <fedor.indutny@gmail.com> Reviewed-By: ofrobots - Ali Ijaz Sheikh <ofrobots@google.com>
For consistency with the newly added src/base64.h header, check that NODE_WANT_INTERNALS is defined and set in internal headers. PR-URL: nodejs#6948 Refs: nodejs#6910 Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Node already has support for base64 encoding and decoding that is not visible outside the string_bytes.cc file. Our work on providing a support for the Chrome inspector protocol (#6792) requires base64 encoding support. Rather then introducing a second copy of the base64 encoder, we suggest moving this code into a separate header. PR-URL: #6910 Reviewed-By: bnoordhuis - Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: indutny - Fedor Indutny <fedor.indutny@gmail.com> Reviewed-By: ofrobots - Ali Ijaz Sheikh <ofrobots@google.com>
For consistency with the newly added src/base64.h header, check that NODE_WANT_INTERNALS is defined and set in internal headers. PR-URL: #6948 Refs: #6910 Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Trevor Norris <trev.norris@gmail.com>
MylesBorins
commented
Jun 3, 2016
@ofrobots@indutny@bnoordhuis@AndreasMadsen should this be included in #7048? |
bnoordhuis
commented
Jun 3, 2016
@thealphanerd No, but it should be included if/when the V8 inspector changes are back-ported. |
This is related to PR #6792
For our protocol, we need Base64 encoder. It already exists in string_bytes.cc so I simply extracted it to the header. For symmetry, I also extracted decoder.