Auto merge of #19498 - ferjm:pwm.f64, r=jdm

Fix float conversion of paint timing metrics

This is a follow up of #19077

- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/19498)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2017-12-07 10:31:45 -06:00 committed by GitHub
commit ff70c4426d
3 changed files with 15 additions and 4 deletions

View file

@ -20,6 +20,7 @@ use dom::performanceobserver::PerformanceObserver as DOMPerformanceObserver;
use dom::performancetiming::PerformanceTiming;
use dom::window::Window;
use dom_struct::dom_struct;
use metrics::ToMs;
use std::cell::Cell;
use std::cmp::Ordering;
use time;
@ -260,7 +261,7 @@ impl Performance {
Some(ref timing) => timing.navigation_start_precise(),
None => self.navigation_start_precise,
};
(time::precise_time_ns() - nav_start) as f64 / 1000000.
(time::precise_time_ns() - nav_start).to_ms()
}
}

View file

@ -9,6 +9,7 @@ use dom::bindings::str::DOMString;
use dom::globalscope::GlobalScope;
use dom::performanceentry::PerformanceEntry;
use dom_struct::dom_struct;
use metrics::ToMs;
use script_traits::ProgressiveWebMetricType;
#[dom_struct]
@ -26,7 +27,7 @@ impl PerformancePaintTiming {
PerformancePaintTiming {
entry: PerformanceEntry::new_inherited(name,
DOMString::from("paint"),
start_time as f64,
start_time.to_ms(),
0.)
}
}