Browse Source

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

Co-authored-by: Shelley Vohr <[email protected]>
trop[bot] 3 years ago
parent
commit
1e23632184
1 changed files with 4 additions and 0 deletions
  1. 4 0
      shell/renderer/web_worker_observer.cc

+ 4 - 0
shell/renderer/web_worker_observer.cc

@@ -50,6 +50,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);