aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/performance.rs
diff options
context:
space:
mode:
authorTetsuharu OHZEKI <saneyuki.snyk@gmail.com>2015-03-25 01:16:08 +0900
committerTetsuharu OHZEKI <saneyuki.snyk@gmail.com>2015-03-25 10:45:30 +0900
commit9cd1b2c158f6a92aa48ed2702f591109b7a32eaa (patch)
treec4a76b71d56f4759b099c4e34b70889b76553e0e /components/script/dom/performance.rs
parent4c96732077d8152055a8988403f07db1277b50a7 (diff)
downloadservo-9cd1b2c158f6a92aa48ed2702f591109b7a32eaa.tar.gz
servo-9cd1b2c158f6a92aa48ed2702f591109b7a32eaa.zip
Use Finite<T> for our dom code (excluding CanvasRenderingContext2D)
Diffstat (limited to 'components/script/dom/performance.rs')
-rw-r--r--components/script/dom/performance.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/components/script/dom/performance.rs b/components/script/dom/performance.rs
index 31f0fd3b31e..45fa9ffe002 100644
--- a/components/script/dom/performance.rs
+++ b/components/script/dom/performance.rs
@@ -6,12 +6,13 @@ use dom::bindings::codegen::Bindings::PerformanceBinding;
use dom::bindings::codegen::Bindings::PerformanceBinding::PerformanceMethods;
use dom::bindings::global::GlobalRef;
use dom::bindings::js::{JS, JSRef, Temporary};
+use dom::bindings::num::Finite;
use dom::bindings::utils::{Reflector, reflect_dom_object};
use dom::performancetiming::{PerformanceTiming, PerformanceTimingHelpers};
use dom::window::Window;
use time;
-pub type DOMHighResTimeStamp = f64;
+pub type DOMHighResTimeStamp = Finite<f64>;
#[dom_struct]
pub struct Performance {
@@ -50,7 +51,8 @@ impl<'a> PerformanceMethods for JSRef<'a, Performance> {
// https://dvcs.w3.org/hg/webperf/raw-file/tip/specs/HighResolutionTime/Overview.html#dom-performance-now
fn Now(self) -> DOMHighResTimeStamp {
let navStart = self.timing.root().r().NavigationStartPrecise();
- (time::precise_time_ns() as f64 - navStart) * 1000000u as DOMHighResTimeStamp
+ let now = (time::precise_time_ns() as f64 - navStart) * 1000000u as f64;
+ Finite::wrap(now)
}
}