summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Roberts <vieuxtech@gmail.com>2019-05-22 12:12:36 -0700
committerAnna Henningsen <anna@addaleax.net>2019-05-26 17:09:45 +0200
commit02f9a0fe27a70062631a39971099e13f54d2b588 (patch)
tree17561268145e62e01e8cdb0f8a4c5d4f9b204af9
parent91ec5bf7ba78039b6ab856c87aa39e3b7ef77c7e (diff)
downloadandroid-node-v8-02f9a0fe27a70062631a39971099e13f54d2b588.tar.gz
android-node-v8-02f9a0fe27a70062631a39971099e13f54d2b588.tar.bz2
android-node-v8-02f9a0fe27a70062631a39971099e13f54d2b588.zip
src: move DiagnosticFilename inlines into a -inl.h
DiagnosticFilename's constructor default values use inlines from env-inl.h, causing the many users of node_internals.h to include env-inl.h, even if they never use DiagnosticFilename. PR-URL: https://github.com/nodejs/node/pull/27839 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
-rw-r--r--src/api/environment.cc1
-rw-r--r--src/api/utils.cc1
-rw-r--r--src/diagnosticfilename-inl.h33
-rw-r--r--src/heap_utils.cc1
-rw-r--r--src/inspector/tracing_agent.cc3
-rw-r--r--src/inspector_io.cc1
-rw-r--r--src/inspector_profiler.cc1
-rw-r--r--src/node_api.cc2
-rw-r--r--src/node_i18n.cc1
-rw-r--r--src/node_internals.h16
-rw-r--r--src/node_report.cc1
-rw-r--r--src/node_report_utils.cc1
-rw-r--r--src/node_trace_events.cc2
-rw-r--r--tools/snapshot/node_mksnapshot.cc1
-rw-r--r--tools/snapshot/snapshot_builder.cc1
15 files changed, 45 insertions, 21 deletions
diff --git a/src/api/environment.cc b/src/api/environment.cc
index e5d06f27d1..eeeef7442d 100644
--- a/src/api/environment.cc
+++ b/src/api/environment.cc
@@ -1,4 +1,3 @@
-#include "env-inl.h"
#include "node.h"
#include "node_context_data.h"
#include "node_errors.h"
diff --git a/src/api/utils.cc b/src/api/utils.cc
index 3e59932f2f..da7281a68f 100644
--- a/src/api/utils.cc
+++ b/src/api/utils.cc
@@ -1,4 +1,3 @@
-#include "env-inl.h"
#include "node.h"
#include "node_internals.h"
#include "util-inl.h"
diff --git a/src/diagnosticfilename-inl.h b/src/diagnosticfilename-inl.h
new file mode 100644
index 0000000000..58a3a933ac
--- /dev/null
+++ b/src/diagnosticfilename-inl.h
@@ -0,0 +1,33 @@
+#ifndef SRC_DIAGNOSTICFILENAME_INL_H_
+#define SRC_DIAGNOSTICFILENAME_INL_H_
+
+#if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
+
+#include "node_internals.h"
+#include "env-inl.h"
+
+namespace node {
+
+inline DiagnosticFilename::DiagnosticFilename(
+ Environment* env,
+ const char* prefix,
+ const char* ext) :
+ filename_(MakeFilename(env->thread_id(), prefix, ext)) {
+}
+
+inline DiagnosticFilename::DiagnosticFilename(
+ uint64_t thread_id,
+ const char* prefix,
+ const char* ext) :
+ filename_(MakeFilename(thread_id, prefix, ext)) {
+}
+
+inline const char* DiagnosticFilename::operator*() const {
+ return filename_.c_str();
+}
+
+} // namespace node
+
+#endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
+
+#endif // SRC_DIAGNOSTICFILENAME_INL_H_
diff --git a/src/heap_utils.cc b/src/heap_utils.cc
index acc63fd1d9..8391f1de37 100644
--- a/src/heap_utils.cc
+++ b/src/heap_utils.cc
@@ -1,3 +1,4 @@
+#include "diagnosticfilename-inl.h"
#include "env-inl.h"
#include "memory_tracker-inl.h"
#include "stream_base-inl.h"
diff --git a/src/inspector/tracing_agent.cc b/src/inspector/tracing_agent.cc
index d87eec6a64..609d70d22f 100644
--- a/src/inspector/tracing_agent.cc
+++ b/src/inspector/tracing_agent.cc
@@ -2,9 +2,6 @@
#include "main_thread_interface.h"
#include "node_internals.h"
#include "node_v8_platform-inl.h"
-
-#include "env-inl.h"
-#include "util-inl.h"
#include "v8.h"
#include <set>
diff --git a/src/inspector_io.cc b/src/inspector_io.cc
index 7ba19087d0..223e3592a1 100644
--- a/src/inspector_io.cc
+++ b/src/inspector_io.cc
@@ -4,7 +4,6 @@
#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"
diff --git a/src/inspector_profiler.cc b/src/inspector_profiler.cc
index 7e76ad778a..2a1559f8f9 100644
--- a/src/inspector_profiler.cc
+++ b/src/inspector_profiler.cc
@@ -2,6 +2,7 @@
#include <sstream>
#include "base_object-inl.h"
#include "debug_utils.h"
+#include "diagnosticfilename-inl.h"
#include "memory_tracker-inl.h"
#include "node_file.h"
#include "node_internals.h"
diff --git a/src/node_api.cc b/src/node_api.cc
index 32393883d7..91e6a14cdc 100644
--- a/src/node_api.cc
+++ b/src/node_api.cc
@@ -1,9 +1,9 @@
-#include <node_buffer.h>
#include "env-inl.h"
#define NAPI_EXPERIMENTAL
#include "js_native_api_v8.h"
#include "node_api.h"
#include "node_binding.h"
+#include "node_buffer.h"
#include "node_errors.h"
#include "node_internals.h"
#include "threadpoolwork-inl.h"
diff --git a/src/node_i18n.cc b/src/node_i18n.cc
index 0c565c447f..8ccda35056 100644
--- a/src/node_i18n.cc
+++ b/src/node_i18n.cc
@@ -45,7 +45,6 @@
#if defined(NODE_HAVE_I18N_SUPPORT)
#include "base_object-inl.h"
-#include "env-inl.h"
#include "node.h"
#include "node_buffer.h"
#include "node_errors.h"
diff --git a/src/node_internals.h b/src/node_internals.h
index f74e67ce6f..4091c3f0d3 100644
--- a/src/node_internals.h
+++ b/src/node_internals.h
@@ -321,17 +321,15 @@ class DiagnosticFilename {
public:
static void LocalTime(TIME_TYPE* tm_struct);
- DiagnosticFilename(Environment* env,
- const char* prefix,
- const char* ext) :
- filename_(MakeFilename(env->thread_id(), prefix, ext)) {}
+ inline DiagnosticFilename(Environment* env,
+ const char* prefix,
+ const char* ext);
- DiagnosticFilename(uint64_t thread_id,
- const char* prefix,
- const char* ext) :
- filename_(MakeFilename(thread_id, prefix, ext)) {}
+ inline DiagnosticFilename(uint64_t thread_id,
+ const char* prefix,
+ const char* ext);
- const char* operator*() const { return filename_.c_str(); }
+ inline const char* operator*() const;
private:
static std::string MakeFilename(
diff --git a/src/node_report.cc b/src/node_report.cc
index 2f668b5463..1860765625 100644
--- a/src/node_report.cc
+++ b/src/node_report.cc
@@ -1,6 +1,7 @@
#include "env-inl.h"
#include "node_report.h"
#include "debug_utils.h"
+#include "diagnosticfilename-inl.h"
#include "node_internals.h"
#include "node_metadata.h"
#include "util.h"
diff --git a/src/node_report_utils.cc b/src/node_report_utils.cc
index 2581af06fa..33d7c52b34 100644
--- a/src/node_report_utils.cc
+++ b/src/node_report_utils.cc
@@ -1,4 +1,3 @@
-#include "env-inl.h"
#include "node_internals.h"
#include "node_report.h"
#include "util-inl.h"
diff --git a/src/node_trace_events.cc b/src/node_trace_events.cc
index 24e1d66fb7..f5852076b4 100644
--- a/src/node_trace_events.cc
+++ b/src/node_trace_events.cc
@@ -1,5 +1,5 @@
#include "base_object-inl.h"
-#include "env.h"
+#include "env-inl.h"
#include "memory_tracker-inl.h"
#include "node.h"
#include "node_internals.h"
diff --git a/tools/snapshot/node_mksnapshot.cc b/tools/snapshot/node_mksnapshot.cc
index 5cf24f32b4..f52cccb705 100644
--- a/tools/snapshot/node_mksnapshot.cc
+++ b/tools/snapshot/node_mksnapshot.cc
@@ -5,7 +5,6 @@
#include <string>
#include <vector>
-#include "env-inl.h"
#include "libplatform/libplatform.h"
#include "node_internals.h"
#include "snapshot_builder.h"
diff --git a/tools/snapshot/snapshot_builder.cc b/tools/snapshot/snapshot_builder.cc
index 1faa5330ae..54a4a2e73d 100644
--- a/tools/snapshot/snapshot_builder.cc
+++ b/tools/snapshot/snapshot_builder.cc
@@ -1,7 +1,6 @@
#include "snapshot_builder.h"
#include <iostream>
#include <sstream>
-#include "env-inl.h"
#include "node_internals.h"
#include "node_main_instance.h"
#include "node_v8_platform-inl.h"