mirror of
https://github.com/servo/servo
synced 2026-04-26 01:25:32 +02:00
prefs: Move Opts::print_pwm to DiagnosticsLogging::progressive_web_metrics (#43209)
This option controls whether progressive web metrics are printed to the system console, which is essentially the purpose of `DiagnosticsLogging`. This makes the API a bit more uniform. Testing: We do not really have automated testing for this kind of feature of the API. Fixes: This is part of #34967. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
This commit is contained in:
@@ -346,9 +346,6 @@ pub struct ScriptThread {
|
||||
/// Periodically print out on which events script threads spend their processing time.
|
||||
profile_script_events: bool,
|
||||
|
||||
/// Print Progressive Web Metrics to console.
|
||||
print_pwm: bool,
|
||||
|
||||
/// Unminify Javascript.
|
||||
unminify_js: bool,
|
||||
|
||||
@@ -1025,7 +1022,6 @@ impl ScriptThread {
|
||||
custom_element_reaction_stack: Rc::new(CustomElementReactionStack::new()),
|
||||
paint_api: state.cross_process_paint_api,
|
||||
profile_script_events: opts.debug.profile_script_events,
|
||||
print_pwm: opts.print_pwm,
|
||||
unminify_js: opts.unminify_js,
|
||||
local_script_source: opts.local_script_source.clone(),
|
||||
unminify_css: opts.unminify_css,
|
||||
@@ -1719,10 +1715,9 @@ impl ScriptThread {
|
||||
for (doc_id, doc) in self.documents.borrow().iter() {
|
||||
if let Some(pipeline_id) = pipeline_id {
|
||||
if pipeline_id == doc_id && task_duration.as_nanos() > MAX_TASK_NS {
|
||||
if self.print_pwm {
|
||||
if opts::get().debug.progressive_web_metrics {
|
||||
println!(
|
||||
"Task took longer than max allowed ({:?}) {:?}",
|
||||
category,
|
||||
"Task took longer than max allowed ({category:?}) {:?}",
|
||||
task_duration.as_nanos()
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user