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: reduced env.h and env-inl.h include lines and added forward declarations of class Environment where necessary. #27928

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/api/async_resource.cc
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include "node.h"
#include "env-inl.h"


class Environment;
namespace node {

using v8::Function;
Expand Down
2 changes: 1 addition & 1 deletion src/api/callback.cc
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#include "node.h"
#include "async_wrap-inl.h"
#include "env-inl.h"
#include "v8.h"

class Environment;
namespace node {

using v8::Context;
Expand Down
2 changes: 1 addition & 1 deletion src/api/exceptions.cc
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// This file contains implementation of error APIs exposed in node.h

#include "env-inl.h"
#include "node.h"
#include "node_errors.h"
#include "util-inl.h"
Expand All @@ -9,6 +8,7 @@

#include <cstring>

class Environment;
namespace node {

using v8::Exception;
Expand Down
2 changes: 1 addition & 1 deletion src/api/hooks.cc
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#include "env-inl.h"
#include "node_internals.h"
#include "node_process.h"
#include "async_wrap.h"

class Environment;
namespace node {

using v8::Context;
Expand Down
3 changes: 2 additions & 1 deletion src/async_wrap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@

#include "async_wrap.h" // NOLINT(build/include_inline)
#include "async_wrap-inl.h"
#include "env-inl.h"
#include "node_errors.h"
#include "tracing/traced_value.h"
#include "util-inl.h"
Expand Down Expand Up @@ -59,6 +58,8 @@ using v8::WeakCallbackType;

using TryCatchScope = node::errors::TryCatchScope;

class Environment;

namespace node {

static const char* const provider_names[] = {
Expand Down
2 changes: 1 addition & 1 deletion src/cares_wrap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
#define CARES_STATICLIB
#include "ares.h"
#include "async_wrap-inl.h"
#include "env-inl.h"
#include "memory_tracker-inl.h"
#include "node.h"
#include "req_wrap-inl.h"
Expand Down Expand Up @@ -53,6 +52,7 @@
# define AI_V4MAPPED 0
#endif

class Environment;
namespace node {
namespace cares_wrap {

Expand Down
2 changes: 1 addition & 1 deletion src/connect_wrap.cc
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#include "connect_wrap.h"

#include "env-inl.h"
#include "req_wrap-inl.h"
#include "util-inl.h"

class Environment;
namespace node {

using v8::Local;
Expand Down
2 changes: 1 addition & 1 deletion src/connection_wrap.cc
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#include "connection_wrap.h"

#include "connect_wrap.h"
#include "env-inl.h"
#include "pipe_wrap.h"
#include "stream_base-inl.h"
#include "stream_wrap.h"
#include "tcp_wrap.h"
#include "util-inl.h"

class Environment;
namespace node {

using v8::Boolean;
Expand Down
3 changes: 1 addition & 2 deletions src/fs_event_wrap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,12 @@
// USE OR OTHER DEALINGS IN THE SOFTWARE.

#include "async_wrap-inl.h"
#include "env-inl.h"
#include "util-inl.h"
#include "node.h"
#include "handle_wrap.h"
#include "string_bytes.h"


class Environment;
namespace node {

using v8::Context;
Expand Down
2 changes: 1 addition & 1 deletion src/handle_wrap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@

#include "handle_wrap.h"
#include "async_wrap-inl.h"
#include "env-inl.h"
#include "util-inl.h"
#include "node.h"

class Environment;
namespace node {

using v8::Context;
Expand Down
2 changes: 1 addition & 1 deletion src/heap_utils.cc
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#include "diagnosticfilename-inl.h"
#include "env-inl.h"
#include "memory_tracker-inl.h"
#include "stream_base-inl.h"
#include "util-inl.h"
Expand All @@ -24,6 +23,7 @@ using v8::ObjectTemplate;
using v8::String;
using v8::Value;

class Environment;
namespace node {
namespace heap {

Expand Down
1 change: 1 addition & 0 deletions src/inspector/tracing_agent.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include <set>
#include <sstream>

class Environment;
namespace node {
namespace inspector {
namespace protocol {
Expand Down
2 changes: 1 addition & 1 deletion src/js_stream.cc
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#include "js_stream.h"

#include "async_wrap.h"
#include "env-inl.h"
#include "node_buffer.h"
#include "node_errors.h"
#include "stream_base-inl.h"
#include "util-inl.h"
#include "v8.h"

class Environment;
namespace node {

using errors::TryCatchScope;
Expand Down
2 changes: 1 addition & 1 deletion src/node_buffer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
#include "node_errors.h"
#include "node_internals.h"

#include "env-inl.h"
#include "string_bytes.h"
#include "string_search.h"
#include "util-inl.h"
Expand All @@ -34,6 +33,7 @@
#include <cstring>
#include <climits>

class Environment;
#define THROW_AND_RETURN_UNLESS_BUFFER(env, obj) \
THROW_AND_RETURN_IF_NOT_BUFFER(env, obj, "argument") \

Expand Down
3 changes: 2 additions & 1 deletion src/node_crypto.cc
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@

#include "async_wrap-inl.h"
#include "base_object-inl.h"
#include "env-inl.h"
#include "memory_tracker-inl.h"
#include "string_bytes.h"
#include "threadpoolwork-inl.h"
Expand Down Expand Up @@ -59,6 +58,8 @@
#include <utility>
#include <vector>

class Environment;

static const int X509_NAME_FLAGS = ASN1_STRFLGS_ESC_CTRL
| ASN1_STRFLGS_UTF8_CONVERT
| XN_FLAG_SEP_MULTILINE
Expand Down
2 changes: 1 addition & 1 deletion src/node_crypto_bio.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@

#include "node_crypto.h"
#include "openssl/bio.h"
#include "env.h"
#include "util.h"
#include "v8.h"

class Environment;
namespace node {
namespace crypto {

Expand Down
3 changes: 1 addition & 2 deletions src/node_http_parser_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
#include "util.h"

#include "async_wrap-inl.h"
#include "env-inl.h"
#include "stream_base-inl.h"
#include "v8.h"

Expand All @@ -50,7 +49,7 @@
// No copying is performed when slicing the buffer, only small reference
// allocations.


class Environment;
namespace node {
namespace { // NOLINT(build/namespaces)

Expand Down
1 change: 1 addition & 0 deletions src/node_i18n.cc
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
#include <unicode/uversion.h>
#include <unicode/ustring.h>

class Environment;
#ifdef NODE_HAVE_SMALL_ICU
/* if this is defined, we have a 'secondary' entry point.
compare following to utypes.h defs for U_ICUDATA_ENTRY_POINT */
Expand Down
2 changes: 1 addition & 1 deletion src/node_platform.cc
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#include "node_platform.h"
#include "node_internals.h"

#include "env-inl.h"
#include "debug_utils.h"
#include <algorithm>
#include <cmath>
#include <memory>

class Environment;
namespace node {

using v8::Isolate;
Expand Down
2 changes: 1 addition & 1 deletion src/node_process_methods.cc
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#include "base_object-inl.h"
#include "env-inl.h"
#include "node.h"
#include "node_errors.h"
#include "node_internals.h"
Expand Down Expand Up @@ -28,6 +27,7 @@ typedef int mode_t;
#include <termios.h> // tcgetattr, tcsetattr
#endif

class Environment;
namespace node {

using v8::Array;
Expand Down
2 changes: 1 addition & 1 deletion src/node_process_object.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#include "env-inl.h"
#include "node_internals.h"
#include "node_options-inl.h"
#include "node_metadata.h"
Expand All @@ -8,6 +7,7 @@

#include <climits> // PATH_MAX

class Environment;
namespace node {
using v8::Context;
using v8::DEFAULT;
Expand Down
2 changes: 1 addition & 1 deletion src/node_task_queue.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#include "env-inl.h"
#include "node.h"
#include "node_errors.h"
#include "node_internals.h"
Expand All @@ -8,6 +7,7 @@

#include <atomic>

class Environment;
namespace node {

using v8::Array;
Expand Down
3 changes: 1 addition & 2 deletions src/node_url.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@
#if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS

#include "node.h"
#include "env.h"

#include <string>

class Environment;
namespace node {
namespace url {

Expand Down
2 changes: 1 addition & 1 deletion src/node_v8_platform-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@

#include <memory>

#include "env-inl.h"
#include "node.h"
#include "node_metadata.h"
#include "node_options.h"
#include "tracing/node_trace_writer.h"
#include "tracing/trace_event.h"
#include "tracing/traced_value.h"

class Environment;
namespace node {

// Ensures that __metadata trace events are only emitted
Expand Down
2 changes: 1 addition & 1 deletion src/node_zlib.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
#include "node_buffer.h"

#include "async_wrap-inl.h"
#include "env-inl.h"
#include "threadpoolwork-inl.h"
#include "util-inl.h"

Expand All @@ -41,6 +40,7 @@
#include <cstring>
#include <atomic>

class Environment;
namespace node {

using v8::Array;
Expand Down
2 changes: 1 addition & 1 deletion src/pipe_wrap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@

#include "async_wrap.h"
#include "connection_wrap.h"
#include "env-inl.h"
#include "handle_wrap.h"
#include "node.h"
#include "node_buffer.h"
Expand All @@ -32,6 +31,7 @@
#include "stream_wrap.h"
#include "util-inl.h"

class Environment;
namespace node {

using v8::Context;
Expand Down
2 changes: 1 addition & 1 deletion src/process_wrap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.

#include "env-inl.h"
#include "stream_base-inl.h"
#include "stream_wrap.h"
#include "util-inl.h"

#include <cstring>
#include <cstdlib>

class Environment;
namespace node {

using v8::Array;
Expand Down
1 change: 1 addition & 0 deletions src/req_wrap-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include "async_wrap-inl.h"
#include "uv.h"

class Environment;
namespace node {

ReqWrapBase::ReqWrapBase(Environment* env) {
Expand Down
2 changes: 1 addition & 1 deletion src/signal_wrap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@
// USE OR OTHER DEALINGS IN THE SOFTWARE.

#include "async_wrap-inl.h"
#include "env-inl.h"
#include "handle_wrap.h"
#include "node_process.h"
#include "util-inl.h"
#include "v8.h"

class Environment;
namespace node {

using v8::Context;
Expand Down
Loading