mirror of
https://github.com/servo/servo.git
synced 2025-08-05 21:50:18 +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::js::{JS, JSRef, Temporary};
|
||||
use dom::bindings::utils::{Reflectable, Reflector, reflect_dom_object};
|
||||
use dom::performancetiming::{PerformanceTiming, PerformanceTimingMethods};
|
||||
use dom::performancetiming::{PerformanceTiming, PerformanceTimingHelpers};
|
||||
use dom::window::Window;
|
||||
use time;
|
||||
|
||||
|
|
|
@ -35,14 +35,19 @@ impl PerformanceTiming {
|
|||
|
||||
pub trait PerformanceTimingMethods {
|
||||
fn NavigationStart(&self) -> u64;
|
||||
fn NavigationStartPrecise(&self) -> f64;
|
||||
}
|
||||
|
||||
impl<'a> PerformanceTimingMethods for JSRef<'a, PerformanceTiming> {
|
||||
fn NavigationStart(&self) -> u64 {
|
||||
self.navigationStart
|
||||
}
|
||||
}
|
||||
|
||||
pub trait PerformanceTimingHelpers {
|
||||
fn NavigationStartPrecise(&self) -> f64;
|
||||
}
|
||||
|
||||
impl<'a> PerformanceTimingHelpers for JSRef<'a, PerformanceTiming> {
|
||||
fn NavigationStartPrecise(&self) -> f64 {
|
||||
self.navigationStartPrecise
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue