Skip to content

Commit 43545f3

Browse files
alferpaltargos
authored andcommitted
src: cleanup unused headers
Node codebase has evolved a lot in the more than 10 years of its existence. As more features (and code) have been added, changed, removed, it's sometimes hard to keep track of what gets used and what not. This commits attempts to clean some of those potentially left-over headers using suggestions from include-what-you-use Refs: #27531 PR-URL: #30328 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Joyee Cheung <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent 9de7196 commit 43545f3

22 files changed

+11
-30
lines changed

src/api/encoding.cc

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#include "node.h"
2-
#include "env-inl.h"
32
#include "string_bytes.h"
43
#include "util-inl.h"
54
#include "v8.h"

src/api/utils.cc

-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
#include "node.h"
2-
#include "node_internals.h"
3-
#include "util-inl.h"
42

53
#include <csignal>
64

src/async_wrap.cc

-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
#include "util-inl.h"
2828

2929
#include "v8.h"
30-
#include "v8-profiler.h"
3130

3231
using v8::Context;
3332
using v8::DontDelete;

src/connect_wrap.cc

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
#include "connect_wrap.h"
2-
3-
#include "env-inl.h"
42
#include "req_wrap-inl.h"
5-
#include "util-inl.h"
63

74
namespace node {
85

96
using v8::Local;
107
using v8::Object;
118

9+
class Environment;
1210

1311
ConnectWrap::ConnectWrap(Environment* env,
1412
Local<Object> req_wrap_obj,

src/connect_wrap.h

-2
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,8 @@
33

44
#if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
55

6-
#include "env.h"
76
#include "req_wrap-inl.h"
87
#include "async_wrap.h"
9-
#include "v8.h"
108

119
namespace node {
1210

src/connection_wrap.h

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
#if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
55

66
#include "stream_wrap.h"
7-
#include "v8.h"
87

98
namespace node {
109

src/debug_utils.cc

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#include "debug_utils.h"
22
#include "env-inl.h"
3-
#include "util-inl.h"
43

54
#ifdef __POSIX__
65
#if defined(__linux__)

src/env.cc

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
#include "node_errors.h"
88
#include "node_file.h"
99
#include "node_internals.h"
10-
#include "node_native_module.h"
1110
#include "node_options-inl.h"
1211
#include "node_process.h"
1312
#include "node_v8_platform-inl.h"

src/fs_event_wrap.cc

-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121

2222
#include "async_wrap-inl.h"
2323
#include "env-inl.h"
24-
#include "util-inl.h"
2524
#include "node.h"
2625
#include "handle_wrap.h"
2726
#include "string_bytes.h"

src/handle_wrap.cc

-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
#include "async_wrap-inl.h"
2424
#include "env-inl.h"
2525
#include "util-inl.h"
26-
#include "node.h"
2726

2827
namespace node {
2928

src/js_stream.cc

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
#include "async_wrap.h"
44
#include "env-inl.h"
5-
#include "node_buffer.h"
65
#include "node_errors.h"
76
#include "stream_base-inl.h"
87
#include "util-inl.h"

src/js_stream.h

-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66
#include "async_wrap.h"
77
#include "stream_base.h"
8-
#include "v8.h"
98

109
namespace node {
1110

src/module_wrap.h

+4-2
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,12 @@
66
#include <unordered_map>
77
#include <string>
88
#include <vector>
9-
#include "node_url.h"
10-
#include "base_object-inl.h"
9+
#include "base_object.h"
1110

1211
namespace node {
12+
13+
class Environment;
14+
1315
namespace loader {
1416

1517
enum ScriptType : int {

src/node_binding.h

-3
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@
1010
#include "node.h"
1111
#define NAPI_EXPERIMENTAL
1212
#include "node_api.h"
13-
#include "util.h"
14-
#include "uv.h"
15-
#include "v8.h"
1613

1714
enum {
1815
NM_F_BUILTIN = 1 << 0, // Unused.

src/node_buffer.cc

-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
#include "string_bytes.h"
2929
#include "string_search.h"
3030
#include "util-inl.h"
31-
#include "v8-profiler.h"
3231
#include "v8.h"
3332

3433
#include <cstring>

src/node_errors.h

-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33

44
#if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
55

6-
#include "node.h"
7-
#include "util.h"
86
#include "env.h"
97
#include "v8.h"
108

src/node_watchdog.h

-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424

2525
#if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
2626

27-
#include "v8.h"
2827
#include "uv.h"
2928
#include "node_mutex.h"
3029
#include <vector>

src/stream_wrap.h

-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626

2727
#include "stream_base.h"
2828
#include "handle_wrap.h"
29-
#include "string_bytes.h"
3029
#include "v8.h"
3130

3231
namespace node {

src/string_bytes.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
// Decodes a v8::Local<v8::String> or Buffer to a raw char*
2828

2929
#include "v8.h"
30-
#include "env.h"
30+
#include "env-inl.h"
3131

3232
namespace node {
3333

src/string_decoder-inl.h

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
#if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
55

66
#include "string_decoder.h"
7-
#include "util.h"
87

98
namespace node {
109

src/tracing/agent.h

+5-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
#include "libplatform/v8-tracing.h"
55
#include "uv.h"
6-
#include "v8.h"
76
#include "util.h"
87
#include "node_mutex.h"
98

@@ -12,6 +11,11 @@
1211
#include <string>
1312
#include <unordered_map>
1413

14+
namespace v8 {
15+
class ConvertableToTraceFormat;
16+
class TracingController;
17+
} // namespace v8
18+
1519
namespace node {
1620
namespace tracing {
1721

src/udp_wrap.h

-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424

2525
#if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
2626

27-
#include "async_wrap.h"
2827
#include "handle_wrap.h"
2928
#include "uv.h"
3029
#include "v8.h"

0 commit comments

Comments
 (0)