Struct script::dom::performance::Performance
source · #[repr(C)]pub struct Performance {
eventtarget: EventTarget,
buffer: DomRefCell<PerformanceEntryList>,
observers: DomRefCell<Vec<PerformanceObserver>>,
pending_notification_observers_task: Cell<bool>,
navigation_start_precise: u64,
resource_timing_buffer_size_limit: Cell<usize>,
resource_timing_buffer_current_size: Cell<usize>,
resource_timing_buffer_pending_full_event: Cell<bool>,
resource_timing_secondary_entries: DomRefCell<VecDeque<Root<Dom<PerformanceEntry>>>>,
}
Fields
eventtarget: EventTarget
buffer: DomRefCell<PerformanceEntryList>
observers: DomRefCell<Vec<PerformanceObserver>>
pending_notification_observers_task: Cell<bool>
resource_timing_buffer_size_limit: Cell<usize>
https://w3c.github.io/performance-timeline/#dfn-maxbuffersize The max-size of the buffer, set to 0 once the pipeline exits. TODO: have one max-size per entry type.
resource_timing_buffer_current_size: Cell<usize>
resource_timing_buffer_pending_full_event: Cell<bool>
resource_timing_secondary_entries: DomRefCell<VecDeque<Root<Dom<PerformanceEntry>>>>
Implementations
sourceimpl Performance
impl Performance
fn __assert_parent_type(&self)
sourceimpl Performance
impl Performance
fn new_inherited(navigation_start_precise: u64) -> Performance
pub fn new(
global: &GlobalScope,
navigation_start_precise: u64
) -> Root<Dom<Performance>>
sourcepub fn clear_and_disable_performance_entry_buffer(&self)
pub fn clear_and_disable_performance_entry_buffer(&self)
Clear all buffered performance entries, and disable the buffer. Called as part of the window’s “clear_js_runtime” workflow, performed when exiting a pipeline.
sourcepub fn add_multiple_type_observer(
&self,
observer: &DOMPerformanceObserver,
entry_types: Vec<DOMString>
)
pub fn add_multiple_type_observer(
&self,
observer: &DOMPerformanceObserver,
entry_types: Vec<DOMString>
)
Add a PerformanceObserver to the list of observers with a set of observed entry types.
pub fn add_single_type_observer(
&self,
observer: &DOMPerformanceObserver,
entry_type: &DOMString,
buffered: bool
)
sourcepub fn remove_observer(&self, observer: &DOMPerformanceObserver)
pub fn remove_observer(&self, observer: &DOMPerformanceObserver)
Remove a PerformanceObserver from the list of observers.
sourcepub fn queue_entry(&self, entry: &PerformanceEntry) -> Option<usize>
pub fn queue_entry(&self, entry: &PerformanceEntry) -> Option<usize>
Queue a notification for each performance observer interested in this type of performance entry and queue a low priority task to notify the observers if no other notification task is already queued.
Algorithm spec: https://w3c.github.io/performance-timeline/#queue-a-performanceentry Also this algorithm has been extented according to : https://w3c.github.io/resource-timing/#sec-extensions-performance-interface
sourcepub fn notify_observers(&self)
pub fn notify_observers(&self)
Observers notifications task.
Algorithm spec (step 7): https://w3c.github.io/performance-timeline/#queue-a-performanceentry
fn now(&self) -> f64
fn can_add_resource_timing_entry(&self) -> bool
fn copy_secondary_resource_timing_buffer(&self)
fn fire_buffer_full_event(&self)
sourcefn should_queue_resource_entry(&self, entry: &PerformanceEntry) -> bool
fn should_queue_resource_entry(&self, entry: &PerformanceEntry) -> bool
add a PerformanceResourceTiming entry
paragraph of
https://w3c.github.io/resource-timing/#sec-extensions-performance-interface
pub fn update_entry(&self, index: usize, entry: &PerformanceEntry)
Trait Implementations
sourceimpl Castable for Performance
impl Castable for Performance
sourcefn is<T>(&self) -> boolwhere
T: DerivedFrom<Self>,
fn is<T>(&self) -> boolwhere
T: DerivedFrom<Self>,
sourcefn upcast<T>(&self) -> &Twhere
T: Castable,
Self: DerivedFrom<T>,
fn upcast<T>(&self) -> &Twhere
T: Castable,
Self: DerivedFrom<T>,
sourcefn downcast<T>(&self) -> Option<&T>where
T: DerivedFrom<Self>,
fn downcast<T>(&self) -> Option<&T>where
T: DerivedFrom<Self>,
sourceimpl DomObject for Performance
impl DomObject for Performance
sourceimpl DomObjectWrap for Performance
impl DomObjectWrap for Performance
sourceconst WRAP: unsafe fn(_: SafeJSContext, _: &GlobalScope, _: Box<Self>) -> Root<Dom<Self>> = {dom::bindings::codegen::Bindings::PerformanceBinding::PerformanceBinding::Wrap as for<'a> unsafe fn(script_runtime::JSContext, &'a dom::globalscope::GlobalScope, std::boxed::Box<dom::performance::Performance>) -> dom::bindings::root::Root<dom::bindings::root::Dom<dom::performance::Performance>>}
const WRAP: unsafe fn(_: SafeJSContext, _: &GlobalScope, _: Box<Self>) -> Root<Dom<Self>> = {dom::bindings::codegen::Bindings::PerformanceBinding::PerformanceBinding::Wrap as for<'a> unsafe fn(script_runtime::JSContext, &'a dom::globalscope::GlobalScope, std::boxed::Box<dom::performance::Performance>) -> dom::bindings::root::Root<dom::bindings::root::Dom<dom::performance::Performance>>}
sourceimpl HasParent for Performance
impl HasParent for Performance
sourcefn as_parent(&self) -> &EventTarget
fn as_parent(&self) -> &EventTarget
This is used in a type assertion to ensure that the source and webidls agree as to what the parent type is
type Parent = EventTarget
sourceimpl IDLInterface for Performance
impl IDLInterface for Performance
sourceimpl JSTraceable for Performance
impl JSTraceable for Performance
sourceimpl MallocSizeOf for Performance
impl MallocSizeOf for Performance
sourcefn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
sourceimpl MutDomObject for Performance
impl MutDomObject for Performance
sourceunsafe fn init_reflector(&self, obj: *mut JSObject)
unsafe fn init_reflector(&self, obj: *mut JSObject)
sourceimpl PartialEq<Performance> for Performance
impl PartialEq<Performance> for Performance
sourcefn eq(&self, other: &Performance) -> bool
fn eq(&self, other: &Performance) -> bool
sourceimpl PerformanceMethods for Performance
impl PerformanceMethods for Performance
fn Timing(&self) -> Root<Dom<PerformanceNavigationTiming>>
fn Now(&self) -> Finite<f64>
fn TimeOrigin(&self) -> Finite<f64>
fn GetEntries(&self) -> Vec<Root<Dom<PerformanceEntry>>> ⓘ
fn GetEntriesByType(
&self,
entry_type: DOMString
) -> Vec<Root<Dom<PerformanceEntry>>> ⓘ
fn GetEntriesByName(
&self,
name: DOMString,
entry_type: Option<DOMString>
) -> Vec<Root<Dom<PerformanceEntry>>> ⓘ
fn Mark(&self, mark_name: DOMString) -> Result<(), Error>
fn ClearMarks(&self, mark_name: Option<DOMString>)
fn Measure(
&self,
measure_name: DOMString,
start_mark: Option<DOMString>,
end_mark: Option<DOMString>
) -> Result<(), Error>
fn ClearMeasures(&self, measure_name: Option<DOMString>)
fn ClearResourceTimings(&self)
fn SetResourceTimingBufferSize(&self, max_size: u32)
fn GetOnresourcetimingbufferfull(&self) -> Option<Rc<EventHandlerNonNull>>
fn SetOnresourcetimingbufferfull(
&self,
listener: Option<Rc<EventHandlerNonNull>>
)
sourceimpl ToJSValConvertible for Performance
impl ToJSValConvertible for Performance
sourceunsafe fn to_jsval(&self, cx: *mut JSContext, rval: MutableHandleValue<'_>)
unsafe fn to_jsval(&self, cx: *mut JSContext, rval: MutableHandleValue<'_>)
self
to a JSVal
. JSAPI failure causes a panic.