mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
Pass the timing information to PerformanceTiming rather than exposing methods.
This commit is contained in:
parent
d67bcfa7ce
commit
e4dc6ca2ec
3 changed files with 22 additions and 16 deletions
|
@ -20,15 +20,23 @@ pub struct Performance {
|
|||
}
|
||||
|
||||
impl Performance {
|
||||
fn new_inherited(window: JSRef<Window>) -> Performance {
|
||||
fn new_inherited(window: JSRef<Window>,
|
||||
navigation_start: u64,
|
||||
navigation_start_precise: f64) -> Performance {
|
||||
Performance {
|
||||
reflector_: Reflector::new(),
|
||||
timing: JS::from_rooted(PerformanceTiming::new(window)),
|
||||
timing: JS::from_rooted(PerformanceTiming::new(window,
|
||||
navigation_start,
|
||||
navigation_start_precise)),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn new(window: JSRef<Window>) -> Temporary<Performance> {
|
||||
reflect_dom_object(box Performance::new_inherited(window),
|
||||
pub fn new(window: JSRef<Window>,
|
||||
navigation_start: u64,
|
||||
navigation_start_precise: f64) -> Temporary<Performance> {
|
||||
reflect_dom_object(box Performance::new_inherited(window,
|
||||
navigation_start,
|
||||
navigation_start_precise),
|
||||
global::Window(window),
|
||||
PerformanceBinding::Wrap)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue