mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Refactor away ScriptThread::alter_resource_utilization().
It's used in two places, one of which already has access to the Window.
This commit is contained in:
parent
c3f0c9054f
commit
a689cf1d34
2 changed files with 21 additions and 24 deletions
|
@ -1583,6 +1583,15 @@ impl Window {
|
|||
pub fn evaluate_media_queries_and_report_changes(&self) {
|
||||
self.media_query_lists.evaluate_and_report_changes();
|
||||
}
|
||||
|
||||
/// Slow down/speed up timers based on visibility.
|
||||
pub fn alter_resource_utilization(&self, visible: bool) {
|
||||
if visible {
|
||||
self.upcast::<GlobalScope>().speed_up_timers();
|
||||
} else {
|
||||
self.upcast::<GlobalScope>().slow_down_timers();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Window {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue