summaryrefslogtreecommitdiff
path: root/src/node_binding.cc
diff options
context:
space:
mode:
authorJoyee Cheung <joyeec9h3@gmail.com>2019-03-08 09:34:46 +0100
committerJoyee Cheung <joyeec9h3@gmail.com>2019-03-12 07:03:53 +0800
commit0a3bcdd26108bb29045a557bc555c3a53c244a55 (patch)
treeb510257ef03b0ad2d04ed9c597677b39bce0405c /src/node_binding.cc
parent963ee0bc736008e01d80fbad973f80fd021735fd (diff)
downloadandroid-node-v8-0a3bcdd26108bb29045a557bc555c3a53c244a55.tar.gz
android-node-v8-0a3bcdd26108bb29045a557bc555c3a53c244a55.tar.bz2
android-node-v8-0a3bcdd26108bb29045a557bc555c3a53c244a55.zip
src: refactor coverage connection
- Refactor the C++ class to be resuable for other types of profiles - Move the try-catch block around coverage collection callback to be inside the callback to silence potential JSON or write errors. - Use Function::Call instead of MakeCallback to call the coverage message callback since it does not actually need async hook handling. This way we no longer needs to disable the async hooks when writing the coverage results. - Renames `lib/internal/coverage-gen/with_profiler.js` to `lib/internal/profiler.js` because it is now the only way to generate coverage. PR-URL: https://github.com/nodejs/node/pull/26513 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Ben Coe <bencoe@gmail.com>
Diffstat (limited to 'src/node_binding.cc')
-rw-r--r--src/node_binding.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/node_binding.cc b/src/node_binding.cc
index 7b87ba6bff..9599cf956b 100644
--- a/src/node_binding.cc
+++ b/src/node_binding.cc
@@ -23,9 +23,9 @@
#endif
#if HAVE_INSPECTOR
-#define NODE_BUILTIN_COVERAGE_MODULES(V) V(coverage)
+#define NODE_BUILTIN_PROFILER_MODULES(V) V(profiler)
#else
-#define NODE_BUILTIN_COVERAGE_MODULES(V)
+#define NODE_BUILTIN_PROFILER_MODULES(V)
#endif
// A list of built-in modules. In order to do module registration
@@ -85,7 +85,7 @@
NODE_BUILTIN_OPENSSL_MODULES(V) \
NODE_BUILTIN_ICU_MODULES(V) \
NODE_BUILTIN_REPORT_MODULES(V) \
- NODE_BUILTIN_COVERAGE_MODULES(V)
+ NODE_BUILTIN_PROFILER_MODULES(V)
// This is used to load built-in modules. Instead of using
// __attribute__((constructor)), we call the _register_<modname>