mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Introduce a PerformanceTimingHelpers trait for the NavigationStartPrecise method.
This commit is contained in:
parent
3a68b9dbf2
commit
0ea0d1ae4b
2 changed files with 7 additions and 2 deletions
|
@ -6,7 +6,7 @@ use dom::bindings::codegen::Bindings::PerformanceBinding;
|
||||||
use dom::bindings::global::Window;
|
use dom::bindings::global::Window;
|
||||||
use dom::bindings::js::{JS, JSRef, Temporary};
|
use dom::bindings::js::{JS, JSRef, Temporary};
|
||||||
use dom::bindings::utils::{Reflectable, Reflector, reflect_dom_object};
|
use dom::bindings::utils::{Reflectable, Reflector, reflect_dom_object};
|
||||||
use dom::performancetiming::{PerformanceTiming, PerformanceTimingMethods};
|
use dom::performancetiming::{PerformanceTiming, PerformanceTimingHelpers};
|
||||||
use dom::window::Window;
|
use dom::window::Window;
|
||||||
use time;
|
use time;
|
||||||
|
|
||||||
|
|
|
@ -35,14 +35,19 @@ impl PerformanceTiming {
|
||||||
|
|
||||||
pub trait PerformanceTimingMethods {
|
pub trait PerformanceTimingMethods {
|
||||||
fn NavigationStart(&self) -> u64;
|
fn NavigationStart(&self) -> u64;
|
||||||
fn NavigationStartPrecise(&self) -> f64;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a> PerformanceTimingMethods for JSRef<'a, PerformanceTiming> {
|
impl<'a> PerformanceTimingMethods for JSRef<'a, PerformanceTiming> {
|
||||||
fn NavigationStart(&self) -> u64 {
|
fn NavigationStart(&self) -> u64 {
|
||||||
self.navigationStart
|
self.navigationStart
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub trait PerformanceTimingHelpers {
|
||||||
|
fn NavigationStartPrecise(&self) -> f64;
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'a> PerformanceTimingHelpers for JSRef<'a, PerformanceTiming> {
|
||||||
fn NavigationStartPrecise(&self) -> f64 {
|
fn NavigationStartPrecise(&self) -> f64 {
|
||||||
self.navigationStartPrecise
|
self.navigationStartPrecise
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue