Make ScriptEvaluate count script execution in DOM events and timers (#34286)

Signed-off-by: Delan Azabani <dazabani@igalia.com>
This commit is contained in:
Delan Azabani 2024-11-19 17:07:38 +08:00 committed by GitHub
parent 4a06dc53f6
commit 26748621cd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 77 additions and 85 deletions

View file

@ -42,6 +42,8 @@ pub fn is_execution_stack_empty() -> bool {
/// RAII struct that pushes and pops entries from the script settings stack.
pub struct AutoEntryScript {
global: DomRoot<GlobalScope>,
#[cfg(feature = "tracing")]
span: tracing::span::EnteredSpan,
}
impl AutoEntryScript {
@ -56,6 +58,8 @@ impl AutoEntryScript {
});
AutoEntryScript {
global: DomRoot::from_ref(global),
#[cfg(feature = "tracing")]
span: tracing::info_span!("ScriptEvaluate", servo_profiling = true).entered(),
}
})
}