mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
changed f64 to u64 for navigation start timing until it had to be float
This commit is contained in:
parent
b23131abf1
commit
0a09ee5cd8
13 changed files with 66 additions and 66 deletions
|
@ -1961,7 +1961,7 @@ impl Document {
|
|||
|
||||
if self.tti_window.borrow().needs_check() {
|
||||
self.get_interactive_metrics().maybe_set_tti(self,
|
||||
InteractiveFlag::TimeToInteractive(self.tti_window.borrow().get_start() as f64));
|
||||
InteractiveFlag::TimeToInteractive(self.tti_window.borrow().get_start()));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -114,13 +114,13 @@ pub struct Performance {
|
|||
entries: DomRefCell<PerformanceEntryList>,
|
||||
observers: DomRefCell<Vec<PerformanceObserver>>,
|
||||
pending_notification_observers_task: Cell<bool>,
|
||||
navigation_start_precise: f64,
|
||||
navigation_start_precise: u64,
|
||||
}
|
||||
|
||||
impl Performance {
|
||||
fn new_inherited(global: &GlobalScope,
|
||||
navigation_start: u64,
|
||||
navigation_start_precise: f64) -> Performance {
|
||||
navigation_start_precise: u64) -> Performance {
|
||||
Performance {
|
||||
reflector_: Reflector::new(),
|
||||
timing: if global.is::<Window>() {
|
||||
|
@ -139,7 +139,7 @@ impl Performance {
|
|||
|
||||
pub fn new(global: &GlobalScope,
|
||||
navigation_start: u64,
|
||||
navigation_start_precise: f64) -> DomRoot<Performance> {
|
||||
navigation_start_precise: u64) -> DomRoot<Performance> {
|
||||
reflect_dom_object(
|
||||
Box::new(Performance::new_inherited(global, navigation_start, navigation_start_precise)),
|
||||
global,
|
||||
|
@ -260,7 +260,7 @@ impl Performance {
|
|||
Some(ref timing) => timing.navigation_start_precise(),
|
||||
None => self.navigation_start_precise,
|
||||
};
|
||||
(time::precise_time_ns() as f64 - nav_start) / 1000000 as f64
|
||||
(time::precise_time_ns() - nav_start) as f64 / 1000000.
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@ pub struct PerformancePaintTiming {
|
|||
}
|
||||
|
||||
impl PerformancePaintTiming {
|
||||
fn new_inherited(metric_type: ProgressiveWebMetricType, start_time: f64) -> PerformancePaintTiming {
|
||||
fn new_inherited(metric_type: ProgressiveWebMetricType, start_time: u64) -> PerformancePaintTiming {
|
||||
let name = match metric_type {
|
||||
ProgressiveWebMetricType::FirstPaint => DOMString::from("first-paint"),
|
||||
ProgressiveWebMetricType::FirstContentfulPaint => DOMString::from("first-contentful-paint"),
|
||||
|
@ -26,7 +26,7 @@ impl PerformancePaintTiming {
|
|||
PerformancePaintTiming {
|
||||
entry: PerformanceEntry::new_inherited(name,
|
||||
DOMString::from("paint"),
|
||||
start_time,
|
||||
start_time as f64,
|
||||
0.)
|
||||
}
|
||||
}
|
||||
|
@ -34,7 +34,7 @@ impl PerformancePaintTiming {
|
|||
#[allow(unrooted_must_root)]
|
||||
pub fn new(global: &GlobalScope,
|
||||
metric_type: ProgressiveWebMetricType,
|
||||
start_time: f64) -> DomRoot<PerformancePaintTiming> {
|
||||
start_time: u64) -> DomRoot<PerformancePaintTiming> {
|
||||
let entry = PerformancePaintTiming::new_inherited(metric_type, start_time);
|
||||
reflect_dom_object(Box::new(entry), global, PerformancePaintTimingBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -15,13 +15,13 @@ use dom_struct::dom_struct;
|
|||
pub struct PerformanceTiming {
|
||||
reflector_: Reflector,
|
||||
navigation_start: u64,
|
||||
navigation_start_precise: f64,
|
||||
navigation_start_precise: u64,
|
||||
document: Dom<Document>,
|
||||
}
|
||||
|
||||
impl PerformanceTiming {
|
||||
fn new_inherited(nav_start: u64,
|
||||
nav_start_precise: f64,
|
||||
nav_start_precise: u64,
|
||||
document: &Document)
|
||||
-> PerformanceTiming {
|
||||
PerformanceTiming {
|
||||
|
@ -35,7 +35,7 @@ impl PerformanceTiming {
|
|||
#[allow(unrooted_must_root)]
|
||||
pub fn new(window: &Window,
|
||||
navigation_start: u64,
|
||||
navigation_start_precise: f64)
|
||||
navigation_start_precise: u64)
|
||||
-> DomRoot<PerformanceTiming> {
|
||||
let timing = PerformanceTiming::new_inherited(navigation_start,
|
||||
navigation_start_precise,
|
||||
|
@ -90,7 +90,7 @@ impl PerformanceTimingMethods for PerformanceTiming {
|
|||
|
||||
|
||||
impl PerformanceTiming {
|
||||
pub fn navigation_start_precise(&self) -> f64 {
|
||||
pub fn navigation_start_precise(&self) -> u64 {
|
||||
self.navigation_start_precise
|
||||
}
|
||||
}
|
||||
|
|
|
@ -186,7 +186,7 @@ pub struct Window {
|
|||
custom_element_registry: MutNullableDom<CustomElementRegistry>,
|
||||
performance: MutNullableDom<Performance>,
|
||||
navigation_start: Cell<u64>,
|
||||
navigation_start_precise: Cell<f64>,
|
||||
navigation_start_precise: Cell<u64>,
|
||||
screen: MutNullableDom<Screen>,
|
||||
session_storage: MutNullableDom<Storage>,
|
||||
local_storage: MutNullableDom<Storage>,
|
||||
|
@ -1045,7 +1045,7 @@ impl Window {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn get_navigation_start(&self) -> f64 {
|
||||
pub fn get_navigation_start(&self) -> u64 {
|
||||
self.navigation_start_precise.get()
|
||||
}
|
||||
|
||||
|
@ -1734,7 +1734,7 @@ impl Window {
|
|||
let current_time = time::get_time();
|
||||
let now = (current_time.sec * 1000 + current_time.nsec as i64 / 1000000) as u64;
|
||||
self.navigation_start.set(now);
|
||||
self.navigation_start_precise.set(time::precise_time_ns() as f64);
|
||||
self.navigation_start_precise.set(time::precise_time_ns());
|
||||
}
|
||||
|
||||
fn send_to_constellation(&self, msg: ScriptMsg) {
|
||||
|
@ -1777,7 +1777,7 @@ impl Window {
|
|||
window_size: Option<WindowSizeData>,
|
||||
origin: MutableOrigin,
|
||||
navigation_start: u64,
|
||||
navigation_start_precise: f64,
|
||||
navigation_start_precise: u64,
|
||||
webgl_chan: WebGLChan,
|
||||
webvr_chan: Option<IpcSender<WebVRMsg>>,
|
||||
microtask_queue: Rc<MicrotaskQueue>,
|
||||
|
|
|
@ -90,7 +90,7 @@ pub struct WorkerGlobalScope {
|
|||
/// `IpcSender` doesn't exist
|
||||
from_devtools_receiver: Receiver<DevtoolScriptControlMsg>,
|
||||
|
||||
navigation_start_precise: f64,
|
||||
navigation_start_precise: u64,
|
||||
performance: MutNullableDom<Performance>,
|
||||
}
|
||||
|
||||
|
@ -124,7 +124,7 @@ impl WorkerGlobalScope {
|
|||
navigator: Default::default(),
|
||||
from_devtools_sender: init.from_devtools_sender,
|
||||
from_devtools_receiver,
|
||||
navigation_start_precise: precise_time_ns() as f64,
|
||||
navigation_start_precise: precise_time_ns(),
|
||||
performance: Default::default(),
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue