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>,
time_origin: CrossProcessInstant,
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>
§time_origin: CrossProcessInstant
The timeOrigin
as described in
https://html.spec.whatwg.org/multipage/#concept-settings-object-time-origin.
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§
source§impl Performance
impl Performance
fn __assert_parent_type(&self)
source§impl Performance
impl Performance
fn new_inherited(time_origin: CrossProcessInstant) -> Performance
pub fn new( global: &GlobalScope, navigation_start: CrossProcessInstant, ) -> Root<Dom<Performance>>
pub(crate) fn to_dom_high_res_time_stamp( &self, instant: CrossProcessInstant, ) -> Finite<f64>
pub(crate) fn maybe_to_dom_high_res_time_stamp( &self, instant: Option<CrossProcessInstant>, ) -> Finite<f64>
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,
can_gc: CanGc,
) -> Option<usize>
pub fn queue_entry( &self, entry: &PerformanceEntry, can_gc: CanGc, ) -> 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 can_add_resource_timing_entry(&self) -> bool
fn copy_secondary_resource_timing_buffer(&self, can_gc: CanGc)
fn fire_buffer_full_event(&self, can_gc: CanGc)
sourcefn should_queue_resource_entry(
&self,
entry: &PerformanceEntry,
can_gc: CanGc,
) -> bool
fn should_queue_resource_entry( &self, entry: &PerformanceEntry, can_gc: CanGc, ) -> 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§
source§impl Castable for Performance
impl Castable for Performance
source§impl DomObject for Performance
impl DomObject for Performance
source§impl DomObjectWrap for Performance
impl DomObjectWrap for Performance
source§const WRAP: unsafe fn(_: SafeJSContext, _: &GlobalScope, _: Option<HandleObject<'_>>, _: Box<Self>, _: CanGc) -> Root<Dom<Self>> = {dom::bindings::codegen::Bindings::PerformanceBinding::Performance_Binding::Wrap as for<'a, 'b> unsafe fn(script_runtime::JSContext, &'a dom::globalscope::GlobalScope, std::option::Option<js::rust::Handle<'b, *mut js::jsapi::JSObject>>, std::boxed::Box<dom::performance::Performance>, script_runtime::CanGc) -> dom::bindings::root::Root<dom::bindings::root::Dom<dom::performance::Performance>>}
const WRAP: unsafe fn(_: SafeJSContext, _: &GlobalScope, _: Option<HandleObject<'_>>, _: Box<Self>, _: CanGc) -> Root<Dom<Self>> = {dom::bindings::codegen::Bindings::PerformanceBinding::Performance_Binding::Wrap as for<'a, 'b> unsafe fn(script_runtime::JSContext, &'a dom::globalscope::GlobalScope, std::option::Option<js::rust::Handle<'b, *mut js::jsapi::JSObject>>, std::boxed::Box<dom::performance::Performance>, script_runtime::CanGc) -> dom::bindings::root::Root<dom::bindings::root::Dom<dom::performance::Performance>>}
source§impl HasParent for Performance
impl HasParent for Performance
source§fn 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
source§impl IDLInterface for Performance
impl IDLInterface for Performance
source§impl MallocSizeOf for Performance
impl MallocSizeOf for Performance
source§fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
source§impl MutDomObject for Performance
impl MutDomObject for Performance
source§impl PartialEq for Performance
impl PartialEq for Performance
source§impl PerformanceMethods<DomTypeHolder> for Performance
impl PerformanceMethods<DomTypeHolder> 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, can_gc: CanGc) -> Result<(), Error>
fn ClearMarks(&self, mark_name: Option<DOMString>)
fn Measure( &self, measure_name: DOMString, start_mark: Option<DOMString>, end_mark: Option<DOMString>, can_gc: CanGc, ) -> 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>>, )
source§impl ToJSValConvertible for Performance
impl ToJSValConvertible for Performance
source§impl Traceable for Performance
impl Traceable for Performance
impl DerivedFrom<EventTarget> for Performance
impl Eq for Performance
Auto Trait Implementations§
impl !Freeze for Performance
impl !RefUnwindSafe for Performance
impl !Send for Performance
impl !Sync for Performance
impl Unpin for Performance
impl !UnwindSafe for Performance
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.source§impl<T> Filterable for T
impl<T> Filterable for T
source§fn filterable(
self,
filter_name: &'static str,
) -> RequestFilterDataProvider<T, fn(_: DataRequest<'_>) -> bool>
fn filterable( self, filter_name: &'static str, ) -> RequestFilterDataProvider<T, fn(_: DataRequest<'_>) -> bool>
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more