From f65cb75c74aa45e94b759846d289272e1e26eb41 Mon Sep 17 00:00:00 2001 From: Sam Roberts Date: Thu, 28 Mar 2019 13:26:34 -0700 Subject: [PATCH] src: remove internal includes from node_crypto.h Remove headers used by node_crypto.cc that were included in node_crypto.h. The header file should only include what it uses itself. PR-URL: https://github.com/nodejs/node/pull/26966 Reviewed-By: Anna Henningsen Reviewed-By: Colin Ihrig Reviewed-By: Ruben Bridgewater Reviewed-By: Richard Lau Reviewed-By: Ben Noordhuis Signed-off-by: Beth Griggs --- src/inspector_io.cc | 2 ++ src/node_crypto.cc | 15 +++++++++++++-- src/node_crypto.h | 23 +++-------------------- src/node_crypto_bio.cc | 1 + src/tls_wrap.h | 1 - 5 files changed, 19 insertions(+), 23 deletions(-) diff --git a/src/inspector_io.cc b/src/inspector_io.cc index 447269bb4952ce..20785fc67787df 100644 --- a/src/inspector_io.cc +++ b/src/inspector_io.cc @@ -3,10 +3,12 @@ #include "inspector_socket_server.h" #include "inspector/main_thread_interface.h" #include "inspector/node_string.h" +#include "base_object-inl.h" #include "env-inl.h" #include "debug_utils.h" #include "node.h" #include "node_crypto.h" +#include "node_internals.h" #include "node_mutex.h" #include "v8-inspector.h" #include "util.h" diff --git a/src/node_crypto.cc b/src/node_crypto.cc index 30400c373901e4..14eb09ec22e8f0 100644 --- a/src/node_crypto.cc +++ b/src/node_crypto.cc @@ -20,9 +20,7 @@ // USE OR OTHER DEALINGS IN THE SOFTWARE. #include "node_crypto.h" -#include "node.h" #include "node_buffer.h" -#include "node_constants.h" #include "node_crypto_bio.h" #include "node_crypto_clienthello-inl.h" #include "node_crypto_groups.h" @@ -32,11 +30,24 @@ #include "tls_wrap.h" // TLSWrap #include "async_wrap-inl.h" +#include "base_object-inl.h" #include "env-inl.h" #include "string_bytes.h" #include "util-inl.h" #include "v8.h" +#include +#include +#ifndef OPENSSL_NO_ENGINE +# include +#endif // !OPENSSL_NO_ENGINE +#include +#include +#include +#include +#include +#include + #include #include // INT_MAX #include diff --git a/src/node_crypto.h b/src/node_crypto.h index a85b0cdeb98b82..45e6271816fc61 100644 --- a/src/node_crypto.h +++ b/src/node_crypto.h @@ -24,34 +24,17 @@ #if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS -#include "node.h" // ClientHelloParser #include "node_crypto_clienthello.h" -#include "node_buffer.h" - #include "env.h" -#include "async_wrap-inl.h" -#include "base_object-inl.h" +#include "base_object.h" +#include "util.h" #include "v8.h" -#include -#include -#include -#ifndef OPENSSL_NO_ENGINE -# include -#endif // !OPENSSL_NO_ENGINE #include -#include -// TODO(shigeki) Remove this after upgrading to 1.1.1 -#include -#include -#include -#include -#include -#include -#include +#include namespace node { namespace crypto { diff --git a/src/node_crypto_bio.cc b/src/node_crypto_bio.cc index 2a3ed936f89321..fcbe30ca9c07c0 100644 --- a/src/node_crypto_bio.cc +++ b/src/node_crypto_bio.cc @@ -19,6 +19,7 @@ // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. +#include "base_object-inl.h" #include "node_crypto_bio.h" #include "openssl/bio.h" #include "util-inl.h" diff --git a/src/tls_wrap.h b/src/tls_wrap.h index be694526abf203..1ab19d3ee02bb9 100644 --- a/src/tls_wrap.h +++ b/src/tls_wrap.h @@ -24,7 +24,6 @@ #if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS -#include "node.h" #include "node_crypto.h" // SSLWrap #include "async_wrap.h"