refactor: use node::tracing::Agent() directly (#45489)

refactor: use node::tracing::Agent()
This commit is contained in:
Shelley Vohr 2025-02-09 21:36:42 +01:00 committed by GitHub
parent 9199d5c610
commit a141f68c83
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 9 additions and 50 deletions

View file

@ -1,7 +1,6 @@
expose_get_builtin_module_function.patch
build_add_gn_build_files.patch
fix_add_default_values_for_variables_in_common_gypi.patch
fix_expose_tracing_agent_and_use_tracing_tracingcontroller_instead.patch
pass_all_globals_through_require.patch
build_modify_js2c_py_to_allow_injection_of_original-fs_and_custom_embedder_js.patch
refactor_allow_embedder_overriding_of_internal_fs_calls.patch

View file

@ -1,44 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Samuel Attard <sattard@atlassian.com>
Date: Fri, 26 Oct 2018 15:35:13 +1100
Subject: fix: expose tracing::Agent and use tracing::TracingController instead
of v8::TracingController
This API is used by Electron to create Node's tracing controller.
diff --git a/src/api/environment.cc b/src/api/environment.cc
index ad323fc800a33c010b0504a4aa55c107498dee26..e044f10284f31f1862b18be752a04b3bd5d53401 100644
--- a/src/api/environment.cc
+++ b/src/api/environment.cc
@@ -567,6 +567,10 @@ MultiIsolatePlatform* GetMultiIsolatePlatform(IsolateData* env) {
return env->platform();
}
+node::tracing::Agent* CreateAgent() {
+ return new node::tracing::Agent();
+}
+
MultiIsolatePlatform* CreatePlatform(
int thread_pool_size,
node::tracing::TracingController* tracing_controller) {
diff --git a/src/node.h b/src/node.h
index 7726d3de1e82689655e8fceb4135eec303498572..e730bde9162df23ae0c0d52cfa594c1d7c4db28b 100644
--- a/src/node.h
+++ b/src/node.h
@@ -133,6 +133,7 @@ struct SnapshotData;
namespace tracing {
+class Agent;
class TracingController;
}
@@ -832,6 +833,8 @@ NODE_EXTERN void GetNodeReport(Environment* env,
NODE_EXTERN MultiIsolatePlatform* GetMultiIsolatePlatform(Environment* env);
NODE_EXTERN MultiIsolatePlatform* GetMultiIsolatePlatform(IsolateData* env);
+NODE_EXTERN node::tracing::Agent* CreateAgent();
+
NODE_DEPRECATED("Use MultiIsolatePlatform::Create() instead",
NODE_EXTERN MultiIsolatePlatform* CreatePlatform(
int thread_pool_size,