refactor: use node::tracing::Agent()
directly (#45489)
refactor: use node::tracing::Agent()
This commit is contained in:
parent
9199d5c610
commit
a141f68c83
5 changed files with 9 additions and 50 deletions
|
@ -90,7 +90,7 @@ v8::Isolate* JavascriptEnvironment::Initialize(uv_loop_t* event_loop,
|
|||
|
||||
// The V8Platform of gin relies on Chromium's task schedule, which has not
|
||||
// been started at this point, so we have to rely on Node's V8Platform.
|
||||
auto* tracing_agent = node::CreateAgent();
|
||||
auto* tracing_agent = new node::tracing::Agent();
|
||||
auto* tracing_controller = tracing_agent->GetTracingController();
|
||||
node::tracing::TraceEventHelper::SetAgent(tracing_agent);
|
||||
platform_ = node::MultiIsolatePlatform::Create(
|
||||
|
|
|
@ -92,8 +92,10 @@ void ElectronRendererClient::DidCreateScriptContext(
|
|||
}
|
||||
|
||||
// Setup node tracing controller.
|
||||
if (!node::tracing::TraceEventHelper::GetAgent())
|
||||
node::tracing::TraceEventHelper::SetAgent(node::CreateAgent());
|
||||
if (!node::tracing::TraceEventHelper::GetAgent()) {
|
||||
auto* tracing_agent = new node::tracing::Agent();
|
||||
node::tracing::TraceEventHelper::SetAgent(tracing_agent);
|
||||
}
|
||||
|
||||
// Setup node environment for each window.
|
||||
v8::Maybe<bool> initialized = node::InitializeContext(renderer_context);
|
||||
|
|
|
@ -54,8 +54,10 @@ void WebWorkerObserver::WorkerScriptReadyForEvaluation(
|
|||
node_bindings_->PrepareEmbedThread();
|
||||
|
||||
// Setup node tracing controller.
|
||||
if (!node::tracing::TraceEventHelper::GetAgent())
|
||||
node::tracing::TraceEventHelper::SetAgent(node::CreateAgent());
|
||||
if (!node::tracing::TraceEventHelper::GetAgent()) {
|
||||
auto* tracing_agent = new node::tracing::Agent();
|
||||
node::tracing::TraceEventHelper::SetAgent(tracing_agent);
|
||||
}
|
||||
|
||||
// Setup node environment for each window.
|
||||
v8::Maybe<bool> initialized = node::InitializeContext(worker_context);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue