#[repr(C)]pub(crate) 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<DomRoot<PerformanceEntry>>>,
}Fields§
§eventtarget: EventTarget§buffer: DomRefCell<PerformanceEntryList>§observers: DomRefCell<Vec<PerformanceObserver>>§pending_notification_observers_task: Cell<bool>§time_origin: CrossProcessInstantThe 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<DomRoot<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(crate) fn new( global: &GlobalScope, navigation_start: CrossProcessInstant, can_gc: CanGc, ) -> DomRoot<Performance>
pub(crate) fn to_dom_high_res_time_stamp( &self, instant: CrossProcessInstant, ) -> DOMHighResTimeStamp
pub(crate) fn maybe_to_dom_high_res_time_stamp( &self, instant: Option<CrossProcessInstant>, ) -> DOMHighResTimeStamp
Sourcepub(crate) fn clear_and_disable_performance_entry_buffer(&self)
pub(crate) 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.
pub(crate) fn add_multiple_type_observer( &self, observer: &DOMPerformanceObserver, entry_types: Vec<EntryType>, )
pub(crate) fn add_single_type_observer( &self, observer: &DOMPerformanceObserver, entry_type: EntryType, buffered: bool, )
Sourcepub(crate) fn remove_observer(&self, observer: &DOMPerformanceObserver)
pub(crate) fn remove_observer(&self, observer: &DOMPerformanceObserver)
Remove a PerformanceObserver from the list of observers.
Sourcepub(crate) fn queue_entry(&self, entry: &PerformanceEntry) -> Option<usize>
pub(crate) 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(crate) fn notify_observers(&self)
pub(crate) 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
Sourcefn fire_buffer_full_event(&self, can_gc: CanGc)
fn fire_buffer_full_event(&self, can_gc: CanGc)
Sourcefn should_queue_resource_entry(&self, entry: &PerformanceEntry) -> bool
fn should_queue_resource_entry(&self, entry: &PerformanceEntry) -> bool
pub(crate) fn update_entry(&self, index: usize, entry: &PerformanceEntry)
Trait Implementations§
§impl Castable for Performance
impl Castable for Performance
Source§impl DomObject for Performance
impl DomObject for Performance
type ReflectorType = ()
Source§fn reflector(&self) -> &Reflector<Self::ReflectorType>
fn reflector(&self) -> &Reflector<Self::ReflectorType>
Source§impl DomObjectWrap<DomTypeHolder> for Performance
impl DomObjectWrap<DomTypeHolder> for Performance
Source§const WRAP: unsafe fn(&mut JSContext, &GlobalScope, Option<HandleObject<'_>>, Box<Self>) -> Root<Dom<Self>> = {script_bindings::codegen::GenericBindings::PerformanceBinding::Wrap::<dom::bindings::codegen::DomTypeHolder::DomTypeHolder> as for<'a, 'b, 'c> unsafe fn(&'a mut js::context::JSContext, &'b dom::globalscope::GlobalScope, std::option::Option<js::rust::Handle<'c, *mut js::jsapi::JSObject>>, std::boxed::Box<dom::performance::performance::Performance>) -> script_bindings::root::Root<script_bindings::root::Dom<dom::performance::performance::Performance>>}
const WRAP: unsafe fn(&mut JSContext, &GlobalScope, Option<HandleObject<'_>>, Box<Self>) -> Root<Dom<Self>> = {script_bindings::codegen::GenericBindings::PerformanceBinding::Wrap::<dom::bindings::codegen::DomTypeHolder::DomTypeHolder> as for<'a, 'b, 'c> unsafe fn(&'a mut js::context::JSContext, &'b dom::globalscope::GlobalScope, std::option::Option<js::rust::Handle<'c, *mut js::jsapi::JSObject>>, std::boxed::Box<dom::performance::performance::Performance>) -> script_bindings::root::Root<script_bindings::root::Dom<dom::performance::performance::Performance>>}
Source§impl Drop for Performance
impl Drop for 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
Source§fn Timing(&self) -> DomRoot<PerformanceNavigationTiming>
fn Timing(&self) -> DomRoot<PerformanceNavigationTiming>
Source§fn Now(&self) -> DOMHighResTimeStamp
fn Now(&self) -> DOMHighResTimeStamp
Source§fn TimeOrigin(&self) -> DOMHighResTimeStamp
fn TimeOrigin(&self) -> DOMHighResTimeStamp
Source§fn GetEntries(&self) -> Vec<DomRoot<PerformanceEntry>> ⓘ
fn GetEntries(&self) -> Vec<DomRoot<PerformanceEntry>> ⓘ
Source§fn GetEntriesByType(
&self,
entry_type: DOMString,
) -> Vec<DomRoot<PerformanceEntry>> ⓘ
fn GetEntriesByType( &self, entry_type: DOMString, ) -> Vec<DomRoot<PerformanceEntry>> ⓘ
Source§fn GetEntriesByName(
&self,
name: DOMString,
entry_type: Option<DOMString>,
) -> Vec<DomRoot<PerformanceEntry>> ⓘ
fn GetEntriesByName( &self, name: DOMString, entry_type: Option<DOMString>, ) -> Vec<DomRoot<PerformanceEntry>> ⓘ
Source§fn ClearMarks(&self, mark_name: Option<DOMString>)
fn ClearMarks(&self, mark_name: Option<DOMString>)
Source§fn Measure(
&self,
measure_name: DOMString,
start_mark: Option<DOMString>,
end_mark: Option<DOMString>,
) -> Fallible<()>
fn Measure( &self, measure_name: DOMString, start_mark: Option<DOMString>, end_mark: Option<DOMString>, ) -> Fallible<()>
Source§fn ClearMeasures(&self, measure_name: Option<DOMString>)
fn ClearMeasures(&self, measure_name: Option<DOMString>)
Source§fn ClearResourceTimings(&self)
fn ClearResourceTimings(&self)
Source§fn SetResourceTimingBufferSize(&self, max_size: u32)
fn SetResourceTimingBufferSize(&self, max_size: u32)
fn GetOnresourcetimingbufferfull( &self, ) -> Option<Rc<EventHandlerNonNull<DomTypeHolder>>>
fn SetOnresourcetimingbufferfull( &self, listener: Option<Rc<EventHandlerNonNull<DomTypeHolder>>>, )
Source§impl ToJSValConvertible for Performance
impl ToJSValConvertible for Performance
Source§unsafe 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.Source§fn safe_to_jsval(&self, cx: &mut JSContext, rval: MutableHandle<'_, Value>)
fn safe_to_jsval(&self, cx: &mut JSContext, rval: MutableHandle<'_, Value>)
self to a JSVal. JSAPI failure causes a panic.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<D, T> DomGlobalGeneric<D> for T
impl<D, T> DomGlobalGeneric<D> for T
Source§fn global_(&self, realm: InRealm<'_>) -> Root<Dom<<D as DomTypes>::GlobalScope>>where
Self: Sized,
fn global_(&self, realm: InRealm<'_>) -> Root<Dom<<D as DomTypes>::GlobalScope>>where
Self: Sized,
GlobalScope] of the realm that the DomObject was created in. If this
object is a Node, this will be different from it’s owning Document if adopted by. For
Nodes it’s almost always better to use NodeTraits::owning_global.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