fix: ensure TracingAgent in place for SWs (#31459)

This commit is contained in:
Shelley Vohr 2021-10-19 15:04:48 +02:00 committed by GitHub
parent 51b49d5bd8
commit 8364375347
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -51,6 +51,10 @@ void WebWorkerObserver::WorkerScriptReadyForEvaluation(
// Start the embed thread.
node_bindings_->PrepareMessageLoop();
// Setup node tracing controller.
if (!node::tracing::TraceEventHelper::GetAgent())
node::tracing::TraceEventHelper::SetAgent(node::CreateAgent());
// Setup node environment for each window.
bool initialized = node::InitializeContext(worker_context);
CHECK(initialized);