diff options
author | Joyee Cheung <joyeec9h3@gmail.com> | 2018-12-19 03:15:36 +0800 |
---|---|---|
committer | Joyee Cheung <joyeec9h3@gmail.com> | 2018-12-21 07:46:30 +0800 |
commit | a29c93a1472947ed053b674cfd670a9d191594ea (patch) | |
tree | 20ae016d819e3d6ed36cebd8f70f4c85c1662d47 /src | |
parent | e9703619e0698953ed71e8faf446b61c11ec89fc (diff) | |
download | android-node-v8-a29c93a1472947ed053b674cfd670a9d191594ea.tar.gz android-node-v8-a29c93a1472947ed053b674cfd670a9d191594ea.tar.bz2 android-node-v8-a29c93a1472947ed053b674cfd670a9d191594ea.zip |
src: move the declaration of http parser versions into node_metadata.h
Instead of putting them in node_internals.h.
PR-URL: https://github.com/nodejs/node/pull/25115
Reviewed-By: Steven R Loomis <srloomis@us.ibm.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Minwoo Jung <minwoo@nodesource.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/node_http_parser_llhttp.cc | 4 | ||||
-rw-r--r-- | src/node_http_parser_traditional.cc | 5 | ||||
-rw-r--r-- | src/node_internals.h | 3 | ||||
-rw-r--r-- | src/node_metadata.cc | 5 | ||||
-rw-r--r-- | src/node_metadata.h | 2 |
5 files changed, 10 insertions, 9 deletions
diff --git a/src/node_http_parser_llhttp.cc b/src/node_http_parser_llhttp.cc index 8728fa2b67..423fb5e104 100644 --- a/src/node_http_parser_llhttp.cc +++ b/src/node_http_parser_llhttp.cc @@ -1,16 +1,18 @@ #define NODE_EXPERIMENTAL_HTTP 1 #include "node_http_parser_impl.h" +#include "node_metadata.h" namespace node { +namespace per_process { const char* const llhttp_version = NODE_STRINGIFY(LLHTTP_VERSION_MAJOR) "." NODE_STRINGIFY(LLHTTP_VERSION_MINOR) "." NODE_STRINGIFY(LLHTTP_VERSION_PATCH); - +} // namespace per_process } // namespace node NODE_MODULE_CONTEXT_AWARE_INTERNAL(http_parser_llhttp, diff --git a/src/node_http_parser_traditional.cc b/src/node_http_parser_traditional.cc index 2ea452239a..89ef65979c 100644 --- a/src/node_http_parser_traditional.cc +++ b/src/node_http_parser_traditional.cc @@ -3,16 +3,17 @@ #endif #include "node_http_parser_impl.h" +#include "node_metadata.h" namespace node { - +namespace per_process { const char* const http_parser_version = NODE_STRINGIFY(HTTP_PARSER_VERSION_MAJOR) "." NODE_STRINGIFY(HTTP_PARSER_VERSION_MINOR) "." NODE_STRINGIFY(HTTP_PARSER_VERSION_PATCH); - +} // namespace per_process } // namespace node NODE_MODULE_CONTEXT_AWARE_INTERNAL(http_parser, node::InitializeHttpParser) diff --git a/src/node_internals.h b/src/node_internals.h index 2c6aad5b96..03017fb4f5 100644 --- a/src/node_internals.h +++ b/src/node_internals.h @@ -698,9 +698,6 @@ static inline const char* errno_string(int errorno) { extern double prog_start_time; -extern const char* const llhttp_version; -extern const char* const http_parser_version; - void Abort(const v8::FunctionCallbackInfo<v8::Value>& args); void Chdir(const v8::FunctionCallbackInfo<v8::Value>& args); void CPUUsage(const v8::FunctionCallbackInfo<v8::Value>& args); diff --git a/src/node_metadata.cc b/src/node_metadata.cc index 3ddec4b36a..a67e747563 100644 --- a/src/node_metadata.cc +++ b/src/node_metadata.cc @@ -2,7 +2,6 @@ #include "ares.h" #include "nghttp2/nghttp2ver.h" #include "node.h" -#include "node_internals.h" #include "util.h" #include "uv.h" #include "v8.h" @@ -44,8 +43,8 @@ Metadata::Versions::Versions() { modules = NODE_STRINGIFY(NODE_MODULE_VERSION); nghttp2 = NGHTTP2_VERSION; napi = NODE_STRINGIFY(NAPI_VERSION); - llhttp = llhttp_version; - http_parser = http_parser_version; + llhttp = per_process::llhttp_version; + http_parser = per_process::http_parser_version; #if HAVE_OPENSSL openssl = GetOpenSSLVersion(); diff --git a/src/node_metadata.h b/src/node_metadata.h index 9f383be5f8..99ccc23cb2 100644 --- a/src/node_metadata.h +++ b/src/node_metadata.h @@ -44,6 +44,8 @@ class Metadata { // Per-process global namespace per_process { extern Metadata metadata; +extern const char* const llhttp_version; +extern const char* const http_parser_version; } } // namespace node |