2727#include " aliased_buffer.h"
2828#if HAVE_INSPECTOR
2929#include " inspector_agent.h"
30+ #include " inspector_profiler.h"
3031#endif
3132#include " handle_wrap.h"
3233#include " node.h"
@@ -67,6 +68,12 @@ namespace tracing {
6768class AgentWriterHandle ;
6869}
6970
71+ #if HAVE_INSPECTOR
72+ namespace profiler {
73+ class V8CoverageConnection ;
74+ } // namespace profiler
75+ #endif // HAVE_INSPECTOR
76+
7077namespace worker {
7178class Worker ;
7279}
@@ -366,7 +373,6 @@ constexpr size_t kFsStatsBufferLength = kFsStatsFieldsNumber * 2;
366373 V (async_hooks_init_function, v8::Function) \
367374 V (async_hooks_promise_resolve_function, v8::Function) \
368375 V (buffer_prototype_object, v8::Object) \
369- V (coverage_connection, v8::Object) \
370376 V (crypto_key_object_constructor, v8::Function) \
371377 V (domain_callback, v8::Function) \
372378 V (domexception_function, v8::Function) \
@@ -390,7 +396,6 @@ constexpr size_t kFsStatsBufferLength = kFsStatsFieldsNumber * 2;
390396 V (inspector_console_extension_installer, v8::Function) \
391397 V (message_port, v8::Object) \
392398 V (native_module_require, v8::Function) \
393- V (on_coverage_message_function, v8::Function) \
394399 V (performance_entry_callback, v8::Function) \
395400 V (performance_entry_template, v8::Function) \
396401 V (process_object, v8::Object) \
@@ -1116,6 +1121,15 @@ class Environment : public MemoryRetainer {
11161121
11171122 inline AsyncRequest* thread_stopper () { return &thread_stopper_; }
11181123
1124+ #if HAVE_INSPECTOR
1125+ void set_coverage_connection (
1126+ std::unique_ptr<profiler::V8CoverageConnection> connection);
1127+ profiler::V8CoverageConnection* coverage_connection ();
1128+
1129+ inline void set_coverage_directory (const char * directory);
1130+ inline const std::string& coverage_directory () const ;
1131+ #endif // HAVE_INSPECTOR
1132+
11191133 private:
11201134 inline void CreateImmediate (native_immediate_callback cb,
11211135 void * data,
@@ -1146,6 +1160,11 @@ class Environment : public MemoryRetainer {
11461160 size_t async_callback_scope_depth_ = 0 ;
11471161 std::vector<double > destroy_async_id_list_;
11481162
1163+ #if HAVE_INSPECTOR
1164+ std::unique_ptr<profiler::V8CoverageConnection> coverage_connection_;
1165+ std::string coverage_directory_;
1166+ #endif // HAVE_INSPECTOR
1167+
11491168 std::shared_ptr<EnvironmentOptions> options_;
11501169 // options_ contains debug options parsed from CLI arguments,
11511170 // while inspector_host_port_ stores the actual inspector host
0 commit comments