mirror of
https://github.com/servo/servo.git
synced 2025-08-04 21:20:23 +01:00
Store Console timers in globals
This commit is contained in:
parent
20b131af17
commit
7a942b1742
4 changed files with 67 additions and 21 deletions
|
@ -25,7 +25,7 @@ use dom::bindings::str::DOMString;
|
|||
use dom::bindings::structuredclone::StructuredCloneData;
|
||||
use dom::bindings::utils::{GlobalStaticData, WindowProxyHandler};
|
||||
use dom::browsingcontext::BrowsingContext;
|
||||
use dom::console::Console;
|
||||
use dom::console::{Console, TimerSet};
|
||||
use dom::crypto::Crypto;
|
||||
use dom::cssstyledeclaration::{CSSModificationAccess, CSSStyleDeclaration};
|
||||
use dom::document::Document;
|
||||
|
@ -276,7 +276,10 @@ pub struct Window {
|
|||
scroll_offsets: DOMRefCell<HashMap<UntrustedNodeAddress, Point2D<f32>>>,
|
||||
|
||||
/// https://html.spec.whatwg.org/multipage/#in-error-reporting-mode
|
||||
in_error_reporting_mode: Cell<bool>
|
||||
in_error_reporting_mode: Cell<bool>,
|
||||
|
||||
/// Timers used by the Console API.
|
||||
console_timers: TimerSet,
|
||||
}
|
||||
|
||||
impl Window {
|
||||
|
@ -1747,10 +1750,16 @@ impl Window {
|
|||
error_reporter: error_reporter,
|
||||
scroll_offsets: DOMRefCell::new(HashMap::new()),
|
||||
in_error_reporting_mode: Cell::new(false),
|
||||
console_timers: TimerSet::new(),
|
||||
};
|
||||
|
||||
WindowBinding::Wrap(runtime.cx(), win)
|
||||
}
|
||||
|
||||
pub fn console_timers(&self) -> &TimerSet {
|
||||
&self.console_timers
|
||||
}
|
||||
|
||||
pub fn live_devtools_updates(&self) -> bool {
|
||||
return self.devtools_wants_updates.get();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue