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§
source§impl Performance
impl Performance
fn __assert_parent_type(&self)
source§impl 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§
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>) -> Root<Dom<Self>> = {dom::bindings::codegen::Bindings::PerformanceBinding::PerformanceBinding::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>) -> dom::bindings::root::Root<dom::bindings::root::Dom<dom::performance::Performance>>}
const WRAP: unsafe fn(_: SafeJSContext, _: &GlobalScope, _: Option<HandleObject<'_>>, _: Box<Self>) -> Root<Dom<Self>> = {dom::bindings::codegen::Bindings::PerformanceBinding::PerformanceBinding::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>) -> 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 JSTraceable for Performance
impl JSTraceable 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§unsafe fn init_reflector(&self, obj: *mut JSObject)
unsafe fn init_reflector(&self, obj: *mut JSObject)
source§impl PartialEq<Performance> for Performance
impl PartialEq<Performance> for Performance
source§fn eq(&self, other: &Performance) -> bool
fn eq(&self, other: &Performance) -> bool
self
and other
values to be equal, and is used
by ==
.